From Jason Turner

[temp.arg.template]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpb3pr99p0/{from.md → to.md} +10 -11
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*. When the *template-argument* names a class template,
6
- only primary class templates are considered when matching the template
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.class.spec]] associated with the
12
- primary class template or primary variable template are considered when
13
- a specialization based on the template *template-parameter* is
14
- instantiated. If a specialization is not visible at the point of
15
- instantiation, and it would have been selected had it been visible, the
16
- program is ill-formed, no diagnostic required.
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: matches partial specialization of eval
91
- eval<B<int, float>> eB; // OK: matches partial specialization of eval
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