Skip to content

[basic.stc.dynamic] Inconsistency beween allocation and deallocation #992

Description

@BlowingWind314

Full name of submitter (unless configured in github; will be published with the issue): Yin Xinyu

[basic.stc.dynamic.allocation]/1 says

... An allocation function can be a function template. Such a template shall declare its return type and first parameter as specified above (that is, template parameter types shall not be used in the return type and first parameter type). Allocation function templates shall have two or more parameters.

[basic.stc.dynamic.deallocation]/3 says

... A deallocation function may be an instance of a function template. Neither the first parameter nor the return type shall depend on a template parameter. A deallocation function template shall have two or more function parameters. A template instance is never a usual deallocation function, regardless of its signature.

Is it intentional that

  • "allocation function" includes two kinds of entities (functions and function templates), but
  • "deallocation function" includes only functions (including instances of a function template)?

Suggested resolution:

Change [basic.stc.dynamic.allocation]/1

... An allocation function can may be an instance of a function template. Such a template shall declare its return type and first parameter as specified above (that is, template parameter types shall not be used in the return type and first parameter type). Allocation function templates shall have two or more parameters.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions