From Jason Turner

[gram.temp]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpgc96ddmm/{from.md → to.md} +60 -14
tmp/tmpgc96ddmm/{from.md → to.md} RENAMED
@@ -1,36 +1,67 @@
1
  ## Templates <a id="gram.temp">[[gram.temp]]</a>
2
 
3
  ``` bnf
4
  template-declaration:
5
- 'template <' template-parameter-list '>' declaration
 
 
 
 
 
 
6
  ```
7
 
8
  ``` bnf
9
  template-parameter-list:
10
  template-parameter
11
  template-parameter-list ',' template-parameter
12
  ```
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ``` bnf
15
  template-parameter:
16
  type-parameter
17
  parameter-declaration
18
  ```
19
 
20
  ``` bnf
21
  type-parameter:
22
  type-parameter-key '...'ₒₚₜ identifierₒₚₜ
23
  type-parameter-key identifierₒₚₜ '=' type-id
24
- 'template <' template-parameter-list '>' type-parameter-key '...'ₒₚₜ identifierₒₚₜ
25
- 'template <' template-parameter-list '>' type-parameter-key identifierₒₚₜ '=' id-expression
 
 
26
  ```
27
 
28
  ``` bnf
29
  type-parameter-key:
30
- 'class'
31
- 'typename'
 
 
 
 
 
 
32
  ```
33
 
34
  ``` bnf
35
  simple-template-id:
36
  template-name '<' template-argument-listₒₚₜ '>'
@@ -59,27 +90,42 @@ template-argument:
59
  constant-expression
60
  type-id
61
  id-expression
62
  ```
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  ``` bnf
65
  typename-specifier:
66
- 'typename' nested-name-specifier identifier
67
- 'typename' nested-name-specifier 'template'ₒₚₜ simple-template-id
68
  ```
69
 
70
  ``` bnf
71
  explicit-instantiation:
72
- 'extern'ₒₚₜ 'template' declaration
73
  ```
74
 
75
  ``` bnf
76
  explicit-specialization:
77
- 'template < >' declaration
78
- ```
79
-
80
- ``` bnf
81
- deduction-guide:
82
- 'explicit'ₒₚₜ template-name '(' parameter-declaration-clause ') ->' simple-template-id ';'
83
  ```
84
 
85
 
 
1
  ## Templates <a id="gram.temp">[[gram.temp]]</a>
2
 
3
  ``` bnf
4
  template-declaration:
5
+ template-head declaration
6
+ template-head concept-definition
7
+ ```
8
+
9
+ ``` bnf
10
+ template-head:
11
+ template '<' template-parameter-list '>' requires-clauseₒₚₜ
12
  ```
13
 
14
  ``` bnf
15
  template-parameter-list:
16
  template-parameter
17
  template-parameter-list ',' template-parameter
18
  ```
19
 
20
+ ``` bnf
21
+ requires-clause:
22
+ requires constraint-logical-or-expression
23
+ ```
24
+
25
+ ``` bnf
26
+ constraint-logical-or-expression:
27
+ constraint-logical-and-expression
28
+ constraint-logical-or-expression '||' constraint-logical-and-expression
29
+ ```
30
+
31
+ ``` bnf
32
+ constraint-logical-and-expression:
33
+ primary-expression
34
+ constraint-logical-and-expression '&&' primary-expression
35
+ ```
36
+
37
  ``` bnf
38
  template-parameter:
39
  type-parameter
40
  parameter-declaration
41
  ```
42
 
43
  ``` bnf
44
  type-parameter:
45
  type-parameter-key '...'ₒₚₜ identifierₒₚₜ
46
  type-parameter-key identifierₒₚₜ '=' type-id
47
+ type-constraint '...'ₒₚₜ identifierₒₚₜ
48
+ type-constraint identifierₒₚₜ '=' type-id
49
+ template-head type-parameter-key '...'ₒₚₜ identifierₒₚₜ
50
+ template-head type-parameter-key identifierₒₚₜ '=' id-expression
51
  ```
52
 
53
  ``` bnf
54
  type-parameter-key:
55
+ class
56
+ typename
57
+ ```
58
+
59
+ ``` bnf
60
+ type-constraint:
61
+ nested-name-specifierₒₚₜ concept-name
62
+ nested-name-specifierₒₚₜ concept-name '<' template-argument-listₒₚₜ '>'
63
  ```
64
 
65
  ``` bnf
66
  simple-template-id:
67
  template-name '<' template-argument-listₒₚₜ '>'
 
90
  constant-expression
91
  type-id
92
  id-expression
93
  ```
94
 
95
+ ``` bnf
96
+ constraint-expression:
97
+ logical-or-expression
98
+ ```
99
+
100
+ ``` bnf
101
+ deduction-guide:
102
+ explicit-specifierₒₚₜ template-name '(' parameter-declaration-clause ')' '->' simple-template-id ';'
103
+ ```
104
+
105
+ ``` bnf
106
+ concept-definition:
107
+ concept concept-name '=' constraint-expression ';'
108
+ ```
109
+
110
+ ``` bnf
111
+ concept-name:
112
+ identifier
113
+ ```
114
+
115
  ``` bnf
116
  typename-specifier:
117
+ typename nested-name-specifier identifier
118
+ typename nested-name-specifier 'templateₒₚₜ ' simple-template-id
119
  ```
120
 
121
  ``` bnf
122
  explicit-instantiation:
123
+ externₒₚₜ template declaration
124
  ```
125
 
126
  ``` bnf
127
  explicit-specialization:
128
+ template '<' '>' declaration
 
 
 
 
 
129
  ```
130
 
131