7
Expressions
[expr]
7.5
Primary expressions
[expr.prim]
7.5.7
Requires expressions
[expr.prim.req]
7.5.7.3
Type requirements
[expr.prim.req.type]
type-requirement
:
typename
nested-name-specifier
o
p
t
type-name
;
1
#
A
type-requirement
asserts the validity of a type
.
[
Note
1
:
The enclosing
requires-expression
will evaluate to
false
if substitution of template arguments fails
.
—
end note
]
[
Example
1
:
template
<
typename
T,
typename
T
::
type
=
0
>
struct
S;
template
<
typename
T
>
using
Ref
=
T
&
;
template
<
typename
T
>
concept
C
=
requires
{
typename
T
::
inner;
// required nested member name
typename
S
<
T
>
;
// required class template specialization
typename
Ref
<
T
>
;
// required alias template substitution, fails if
T
is void
}
;
—
end example
]
2
#
A
type-requirement
that names a class template specialization does not require that type to be complete (
[basic.
types]
)
.