From Jason Turner

[expr.prim.req.type]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpbv22m37q/{from.md → to.md} +30 -0
tmp/tmpbv22m37q/{from.md → to.md} RENAMED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Type requirements <a id="expr.prim.req.type">[[expr.prim.req.type]]</a>
2
+
3
+ ``` bnf
4
+ type-requirement:
5
+ typename nested-name-specifierₒₚₜ type-name ';'
6
+ ```
7
+
8
+ A *type-requirement* asserts the validity of a type.
9
+
10
+ [*Note 1*: The enclosing *requires-expression* will evaluate to `false`
11
+ if substitution of template arguments fails. — *end note*]
12
+
13
+ [*Example 1*:
14
+
15
+ ``` cpp
16
+ template<typename T, typename T::type = 0> struct S;
17
+ template<typename T> using Ref = T&;
18
+
19
+ template<typename T> concept C = requires {
20
+ typename T::inner; // required nested member name
21
+ typename S<T>; // required class template specialization
22
+ typename Ref<T>; // required alias template substitution, fails if T is void
23
+ };
24
+ ```
25
+
26
+ — *end example*]
27
+
28
+ A *type-requirement* that names a class template specialization does not
29
+ require that type to be complete [[basic.types]].
30
+