You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Except for template non-type arguments, other kinds of template arguments are less or more to be given the corresponding grammar meaning. A template type argument is type-id, as per
A template-argument for a template-parameter which is a type shall be a type-id.
A template template argument is expresses as id-expression, as per
A template-argument for a template template-parameter shall be the name of a class template or an alias template, expressed as id-expression.
We just lack to specify the grammar meaning for non-type arguments. Maybe, we should give a similar rule that:
A template-argument for a non-type template-parameter shall be a converted constant expression ([expr.const]) of the type of the template-parameter, expressed as constant-expression.
which conforms to
template-argument
constant-expression
type-id
id-expression
The modification can also clarify the example in [expr.const] p14 by the way.
X<std::is_constant_evaluated()> x; // type X<true>
The actual reason is that std::is_constant_evaluated() is evaluated in the context of constant-expression
The text was updated successfully, but these errors were encountered:
Except for template non-type arguments, other kinds of template arguments are less or more to be given the corresponding grammar meaning. A template type argument is type-id, as per
A template template argument is expresses as id-expression, as per
We just lack to specify the grammar meaning for non-type arguments. Maybe, we should give a similar rule that:
which conforms to
The modification can also clarify the example in [expr.const] p14 by the way.
X<std::is_constant_evaluated()> x; // type X<true>
The actual reason is that
std::is_constant_evaluated()
is evaluated in the context of constant-expressionThe text was updated successfully, but these errors were encountered: