Annex A (informative) Grammar summary [gram]

A.10 Templates [gram.temp]

template-declaration:
template-head declaration
template-head concept-definition
template-head:
template < template-parameter-list > requires-clause
template-parameter-list:
template-parameter
template-parameter-list , template-parameter
requires-clause:
requires constraint-logical-or-expression
constraint-logical-or-expression:
constraint-logical-and-expression
constraint-logical-or-expression || constraint-logical-and-expression
constraint-logical-and-expression:
primary-expression
constraint-logical-and-expression && primary-expression
template-parameter:
type-parameter
parameter-declaration
type-parameter:
type-parameter-key ... identifier
type-parameter-key identifier = type-id
type-constraint ... identifier
type-constraint identifier = type-id
template-head type-parameter-key ... identifier
template-head type-parameter-key identifier = id-expression
type-parameter-key:
class
typename
type-constraint:
nested-name-specifier concept-name
nested-name-specifier concept-name < template-argument-list >
simple-template-id:
template-name < template-argument-list >
template-id:
simple-template-id
operator-function-id < template-argument-list >
literal-operator-id < template-argument-list >
template-name:
identifier
template-argument-list:
template-argument ...
template-argument-list , template-argument ...
template-argument:
constant-expression
type-id
id-expression
constraint-expression:
logical-or-expression
deduction-guide:
explicit-specifier template-name ( parameter-declaration-clause ) -> simple-template-id ;
concept-definition:
concept concept-name = constraint-expression ;
concept-name:
identifier
typename-specifier:
typename nested-name-specifier identifier
typename nested-name-specifier template simple-template-id
explicit-instantiation:
extern template declaration
explicit-specialization:
template < > declaration