tmp/tmpb3pr99p0/{from.md → to.md}
RENAMED
|
@@ -1,21 +1,20 @@
|
|
| 1 |
### Template template arguments <a id="temp.arg.template">[[temp.arg.template]]</a>
|
| 2 |
|
| 3 |
A *template-argument* for a template *template-parameter* shall be the
|
| 4 |
name of a class template or an alias template, expressed as
|
| 5 |
-
*id-expression*.
|
| 6 |
-
|
| 7 |
-
template argument with the corresponding parameter; partial
|
| 8 |
specializations are not considered even if their parameter lists match
|
| 9 |
that of the template template parameter.
|
| 10 |
|
| 11 |
-
Any partial specializations [[temp.
|
| 12 |
-
primary
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
[*Example 1*:
|
| 19 |
|
| 20 |
``` cpp
|
| 21 |
template<class T> class A { // primary template
|
|
@@ -85,12 +84,12 @@ template <class T1> struct A;
|
|
| 85 |
template <class T1, class T2> struct B;
|
| 86 |
template <int N> struct C;
|
| 87 |
template <class T1, int N> struct D;
|
| 88 |
template <class T1, class T2, int N = 17> struct E;
|
| 89 |
|
| 90 |
-
eval<A<int>> eA; // OK
|
| 91 |
-
eval<B<int, float>> eB; // OK
|
| 92 |
eval<C<17>> eC; // error: C does not match TT in partial specialization
|
| 93 |
eval<D<int, 17>> eD; // error: D does not match TT in partial specialization
|
| 94 |
eval<E<int, float>> eE; // error: E does not match TT in partial specialization
|
| 95 |
```
|
| 96 |
|
|
|
|
| 1 |
### Template template arguments <a id="temp.arg.template">[[temp.arg.template]]</a>
|
| 2 |
|
| 3 |
A *template-argument* for a template *template-parameter* shall be the
|
| 4 |
name of a class template or an alias template, expressed as
|
| 5 |
+
*id-expression*. Only primary templates are considered when matching the
|
| 6 |
+
template template argument with the corresponding parameter; partial
|
|
|
|
| 7 |
specializations are not considered even if their parameter lists match
|
| 8 |
that of the template template parameter.
|
| 9 |
|
| 10 |
+
Any partial specializations [[temp.spec.partial]] associated with the
|
| 11 |
+
primary template are considered when a specialization based on the
|
| 12 |
+
template *template-parameter* is instantiated. If a specialization is
|
| 13 |
+
not reachable from the point of instantiation, and it would have been
|
| 14 |
+
selected had it been reachable, the program is ill-formed, no diagnostic
|
| 15 |
+
required.
|
| 16 |
|
| 17 |
[*Example 1*:
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
template<class T> class A { // primary template
|
|
|
|
| 84 |
template <class T1, class T2> struct B;
|
| 85 |
template <int N> struct C;
|
| 86 |
template <class T1, int N> struct D;
|
| 87 |
template <class T1, class T2, int N = 17> struct E;
|
| 88 |
|
| 89 |
+
eval<A<int>> eA; // OK, matches partial specialization of eval
|
| 90 |
+
eval<B<int, float>> eB; // OK, matches partial specialization of eval
|
| 91 |
eval<C<17>> eC; // error: C does not match TT in partial specialization
|
| 92 |
eval<D<int, 17>> eD; // error: D does not match TT in partial specialization
|
| 93 |
eval<E<int, float>> eE; // error: E does not match TT in partial specialization
|
| 94 |
```
|
| 95 |
|