tmp/tmpwm4ajo23/{from.md → to.md}
RENAMED
|
@@ -1,30 +1,37 @@
|
|
| 1 |
#### Class template argument deduction <a id="over.match.class.deduct">[[over.match.class.deduct]]</a>
|
| 2 |
|
| 3 |
When resolving a placeholder for a deduced class type
|
| 4 |
-
[[dcl.type.class.deduct]] where the *template-name*
|
| 5 |
-
class template `C`, a set
|
| 6 |
-
the guides of `C`, is formed
|
|
|
|
| 7 |
|
| 8 |
- If `C` is defined, for each constructor of `C`, a function template
|
| 9 |
with the following properties:
|
| 10 |
- The template parameters are the template parameters of `C` followed
|
| 11 |
by the template parameters (including default template arguments) of
|
| 12 |
the constructor, if any.
|
| 13 |
-
- The
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
- The return type is the class template specialization designated by
|
| 15 |
`C` and template arguments corresponding to the template parameters
|
| 16 |
of `C`.
|
| 17 |
- If `C` is not defined or does not declare any constructors, an
|
| 18 |
additional function template derived as above from a hypothetical
|
| 19 |
constructor `C()`.
|
| 20 |
- An additional function template derived as above from a hypothetical
|
| 21 |
constructor `C(C)`, called the *copy deduction candidate*.
|
| 22 |
- For each *deduction-guide*, a function or function template with the
|
| 23 |
following properties:
|
| 24 |
-
- The template
|
| 25 |
-
of the *deduction-guide*.
|
| 26 |
- The return type is the *simple-template-id* of the
|
| 27 |
*deduction-guide*.
|
| 28 |
|
| 29 |
In addition, if `C` is defined and its definition satisfies the
|
| 30 |
conditions for an aggregate class [[dcl.init.aggr]] with the assumption
|
|
@@ -84,11 +91,11 @@ specialization whose template parameter list is that of `A` and whose
|
|
| 84 |
template argument list is a specialization of `A` with the template
|
| 85 |
argument list of `A` [[temp.dep.type]] having a member typedef `type`
|
| 86 |
designating a template specialization with the template argument list of
|
| 87 |
`A` but with `C` as the template.
|
| 88 |
|
| 89 |
-
[*Note
|
| 90 |
specialization is that of `C`, the template argument list of the
|
| 91 |
specialization is `B`, and the member typedef names `C` with the
|
| 92 |
template argument list of `C`. — *end note*]
|
| 93 |
|
| 94 |
[*Example 1*:
|
|
@@ -141,12 +148,13 @@ J j = { "ghi" }; // error: cannot bind reference to array of unsigned char to
|
|
| 141 |
```
|
| 142 |
|
| 143 |
— *end example*]
|
| 144 |
|
| 145 |
When resolving a placeholder for a deduced class type
|
| 146 |
-
[[dcl.type.simple]] where the *template-name*
|
| 147 |
-
`A`, the *defining-type-id* of `A` must be
|
|
|
|
| 148 |
|
| 149 |
``` bnf
|
| 150 |
typenameₒₚₜ nested-name-specifierₒₚₜ templateₒₚₜ simple-template-id
|
| 151 |
```
|
| 152 |
|
|
|
|
| 1 |
#### Class template argument deduction <a id="over.match.class.deduct">[[over.match.class.deduct]]</a>
|
| 2 |
|
| 3 |
When resolving a placeholder for a deduced class type
|
| 4 |
+
[[dcl.type.class.deduct]] where the *template-name* or
|
| 5 |
+
*splice-type-specifier* designates a primary class template `C`, a set
|
| 6 |
+
of functions and function templates, called the guides of `C`, is formed
|
| 7 |
+
comprising:
|
| 8 |
|
| 9 |
- If `C` is defined, for each constructor of `C`, a function template
|
| 10 |
with the following properties:
|
| 11 |
- The template parameters are the template parameters of `C` followed
|
| 12 |
by the template parameters (including default template arguments) of
|
| 13 |
the constructor, if any.
|
| 14 |
+
- The associated constraints [[temp.constr.decl]] are the conjunction
|
| 15 |
+
of the associated constraints of `C` and the associated constraints
|
| 16 |
+
of the constructor, if any. \[*Note 1*: A *constraint-expression* in
|
| 17 |
+
the *template-head* of `C` is checked for satisfaction before any
|
| 18 |
+
constraints from the *template-head* or trailing *requires-clause*
|
| 19 |
+
of the constructor. — *end note*]
|
| 20 |
+
- The *parameter-declaration-clause* is that of the constructor.
|
| 21 |
- The return type is the class template specialization designated by
|
| 22 |
`C` and template arguments corresponding to the template parameters
|
| 23 |
of `C`.
|
| 24 |
- If `C` is not defined or does not declare any constructors, an
|
| 25 |
additional function template derived as above from a hypothetical
|
| 26 |
constructor `C()`.
|
| 27 |
- An additional function template derived as above from a hypothetical
|
| 28 |
constructor `C(C)`, called the *copy deduction candidate*.
|
| 29 |
- For each *deduction-guide*, a function or function template with the
|
| 30 |
following properties:
|
| 31 |
+
- The *template-head*, if any, and *parameter-declaration-clause* are
|
| 32 |
+
those of the *deduction-guide*.
|
| 33 |
- The return type is the *simple-template-id* of the
|
| 34 |
*deduction-guide*.
|
| 35 |
|
| 36 |
In addition, if `C` is defined and its definition satisfies the
|
| 37 |
conditions for an aggregate class [[dcl.init.aggr]] with the assumption
|
|
|
|
| 91 |
template argument list is a specialization of `A` with the template
|
| 92 |
argument list of `A` [[temp.dep.type]] having a member typedef `type`
|
| 93 |
designating a template specialization with the template argument list of
|
| 94 |
`A` but with `C` as the template.
|
| 95 |
|
| 96 |
+
[*Note 2*: Equivalently, the template parameter list of the
|
| 97 |
specialization is that of `C`, the template argument list of the
|
| 98 |
specialization is `B`, and the member typedef names `C` with the
|
| 99 |
template argument list of `C`. — *end note*]
|
| 100 |
|
| 101 |
[*Example 1*:
|
|
|
|
| 148 |
```
|
| 149 |
|
| 150 |
— *end example*]
|
| 151 |
|
| 152 |
When resolving a placeholder for a deduced class type
|
| 153 |
+
[[dcl.type.simple]] where the *template-name* or *splice-type-specifier*
|
| 154 |
+
designates an alias template `A`, the *defining-type-id* of `A` must be
|
| 155 |
+
of the form
|
| 156 |
|
| 157 |
``` bnf
|
| 158 |
typenameₒₚₜ nested-name-specifierₒₚₜ templateₒₚₜ simple-template-id
|
| 159 |
```
|
| 160 |
|