Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dcl.type.auto.deduct]/2.3 superfluous? #2938

Open
tjs137 opened this issue Jun 21, 2019 · 1 comment
Open

[dcl.type.auto.deduct]/2.3 superfluous? #2938

tjs137 opened this issue Jun 21, 2019 · 1 comment
Labels
cwg Issue must be reviewed by CWG.

Comments

@tjs137
Copy link

tjs137 commented Jun 21, 2019

[dcl.type.auto.deduct]/2(.3) directly provides placeholder type deduction for a non-type template parameter.

A type T containing a placeholder type, and a corresponding initializer e, are determined as follows:

  • for a non-type template parameter declared with a type that contains a placeholder type, T is the declared type of the non-type template parameter and e is the corresponding template argument.

[temp.arg.nontype]/1 provides the same thing

If the type T of a template-parameter contains a placeholder type or a placeholder for a deduced class type, the type of the parameter is the type deduced for the variable x in the invented declaration T x =template-argument;

but by using [dcl.type.auto.deduct]/2.2

  • for a variable declared with a type that contains a placeholder type, T is the declared type of the variable and e is the initializer. …

With that, it doesn't seem like [dcl.type.auto.deduct]/2.3 is necessary. Besides, [dcl.type.class.deduct] does not directly provide for replacement of deduced class type placeholders in non-type template parameters, only in an initializing variable declaration.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Jun 24, 2019
@jensmaurer
Copy link
Member

Editorial meeting: Prefer defining an abstract operations and using it when defining concrete operations, instead of defining a concrete operation and defining other concrete operations on top of that. temp.arg.nontype approach is less pleasing; remove that and keep dcl.type.auto.deduct. In temp.arg.non.type, say "the type of the parameter is deduced as specified in dcl.type.auto.deduct".
9.1.7.6 does not cover non-type template parameter, because it doesn't say what happens for them. Not to be done editorially, but a cleanup would be nice.

@jensmaurer jensmaurer added cwg Issue must be reviewed by CWG. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG.
Projects
None yet
Development

No branches or pull requests

2 participants