tmp/tmppbifayzc/{from.md → to.md}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
| 1 |
#### Deduction guides <a id="temp.deduct.guide">[[temp.deduct.guide]]</a>
|
| 2 |
|
| 3 |
-
Deduction guides are used when a *template-name*
|
| 4 |
-
specifier
|
| 5 |
-
guides are not found by name
|
| 6 |
-
|
| 7 |
-
deduction guides declared for
|
|
|
|
| 8 |
|
| 9 |
``` bnf
|
| 10 |
deduction-guide:
|
| 11 |
-
explicit-specifierₒₚₜ template-name '(' parameter-declaration-clause ')' '->' simple-template-id ';'
|
| 12 |
```
|
| 13 |
|
| 14 |
[*Example 1*:
|
| 15 |
|
| 16 |
``` cpp
|
|
@@ -29,11 +30,13 @@ S x{A()}; // x is of type S<short, int>
|
|
| 29 |
```
|
| 30 |
|
| 31 |
— *end example*]
|
| 32 |
|
| 33 |
The same restrictions apply to the *parameter-declaration-clause* of a
|
| 34 |
-
deduction guide as in a function declaration [[dcl.fct]]
|
|
|
|
|
|
|
| 35 |
*simple-template-id* shall name a class template specialization. The
|
| 36 |
*template-name* shall be the same *identifier* as the *template-name* of
|
| 37 |
the *simple-template-id*. A *deduction-guide* shall inhabit the scope to
|
| 38 |
which the corresponding class template belongs and, for a member class
|
| 39 |
template, have the same access. Two deduction guide declarations for the
|
|
|
|
| 1 |
#### Deduction guides <a id="temp.deduct.guide">[[temp.deduct.guide]]</a>
|
| 2 |
|
| 3 |
+
Deduction guides are used when a *template-name* or
|
| 4 |
+
*splice-type-specifier* appears as a type specifier for a deduced class
|
| 5 |
+
type [[dcl.type.class.deduct]]. Deduction guides are not found by name
|
| 6 |
+
lookup. Instead, when performing class template argument deduction
|
| 7 |
+
[[over.match.class.deduct]], all reachable deduction guides declared for
|
| 8 |
+
the class template are considered.
|
| 9 |
|
| 10 |
``` bnf
|
| 11 |
deduction-guide:
|
| 12 |
+
explicit-specifierₒₚₜ template-name '(' parameter-declaration-clause ')' '->' simple-template-id requires-clauseₒₚₜ ';'
|
| 13 |
```
|
| 14 |
|
| 15 |
[*Example 1*:
|
| 16 |
|
| 17 |
``` cpp
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
— *end example*]
|
| 33 |
|
| 34 |
The same restrictions apply to the *parameter-declaration-clause* of a
|
| 35 |
+
deduction guide as in a function declaration [[dcl.fct]], except that a
|
| 36 |
+
generic parameter type placeholder [[dcl.spec.auto]] shall not appear in
|
| 37 |
+
the *parameter-declaration-clause* of a deduction guide. The
|
| 38 |
*simple-template-id* shall name a class template specialization. The
|
| 39 |
*template-name* shall be the same *identifier* as the *template-name* of
|
| 40 |
the *simple-template-id*. A *deduction-guide* shall inhabit the scope to
|
| 41 |
which the corresponding class template belongs and, for a member class
|
| 42 |
template, have the same access. Two deduction guide declarations for the
|