[temp.arg.nontype] Clarify the grammar meaning of template non-type argument
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the [temp.arg.nontype] wording and compare it with the grammar and discussion in [expr.const]. Clarify the grammar meaning of non-type template arguments, including whether the proposed constant-expression wording fits the existing template-argument alternatives and the is_constant_evaluated() example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, tex
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100