Annex A (informative)
Grammar summary
[gram]
A.11
Templates
[gram.temp]
template-declaration
:
template-head
declaration
template-head
concept-definition
template-head
:
template
<
template-parameter-list
>
requires-clause
o
p
t
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
.
.
.
o
p
t
identifier
o
p
t
type-parameter-key
identifier
o
p
t
=
type-id
type-constraint
.
.
.
o
p
t
identifier
o
p
t
type-constraint
identifier
o
p
t
=
type-id
template-head
type-parameter-key
.
.
.
o
p
t
identifier
o
p
t
template-head
type-parameter-key
identifier
o
p
t
=
id-expression
type-parameter-key
:
class
typename
type-constraint
:
nested-name-specifier
o
p
t
concept-name
nested-name-specifier
o
p
t
concept-name
<
template-argument-list
o
p
t
>
simple-template-id
:
template-name
<
template-argument-list
o
p
t
>
template-id
:
simple-template-id
operator-function-id
<
template-argument-list
o
p
t
>
literal-operator-id
<
template-argument-list
o
p
t
>
template-name
:
identifier
template-argument-list
:
template-argument
.
.
.
o
p
t
template-argument-list
,
template-argument
.
.
.
o
p
t
template-argument
:
constant-expression
type-id
id-expression
braced-init-list
constraint-expression
:
logical-or-expression
deduction-guide
:
explicit-specifier
o
p
t
template-name
(
parameter-declaration-clause
)
requires-clause
o
p
t
-
>
simple-template-id
;
concept-definition
:
concept
concept-name
attribute-specifier-seq
o
p
t
=
constraint-expression
;
concept-name
:
identifier
typename-specifier
:
typename
nested-name-specifier
identifier
typename
nested-name-specifier
template
o
p
t
simple-template-id
explicit-instantiation
:
extern
o
p
t
template
declaration
explicit-specialization
:
template
<
>
declaration