tmp/tmp_1a_3jcu/{from.md → to.md}
RENAMED
|
@@ -23,11 +23,12 @@ The `>` token following the of a may be the product of replacing a
|
|
| 23 |
|
| 24 |
There is no semantic difference between `class` and `typename` in a
|
| 25 |
*template-parameter*. `typename` followed by an *unqualified-id* names a
|
| 26 |
template type parameter. `typename` followed by a *qualified-id* denotes
|
| 27 |
the type in a non-type [^1] *parameter-declaration*. A storage class
|
| 28 |
-
shall not be specified in a *template-parameter* declaration.
|
|
|
|
| 29 |
parameter may be a class template. For example,
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
template<class T> class myarray { /* ... */ };
|
| 33 |
|
|
@@ -152,18 +153,19 @@ default *template-argument*, each subsequent *template-parameter* shall
|
|
| 152 |
either have a default *template-argument* supplied or be a template
|
| 153 |
parameter pack. If a *template-parameter* of a primary class template or
|
| 154 |
alias template is a template parameter pack, it shall be the last
|
| 155 |
*template-parameter*. A template parameter pack of a function template
|
| 156 |
shall not be followed by another template parameter unless that template
|
| 157 |
-
parameter can be deduced
|
|
|
|
| 158 |
|
| 159 |
``` cpp
|
| 160 |
template<class T1 = int, class T2> class B; // error
|
| 161 |
|
| 162 |
-
// U
|
| 163 |
-
template<class... T, class... U> void f() { }
|
| 164 |
-
template<class... T, class U> void g() { }
|
| 165 |
```
|
| 166 |
|
| 167 |
A *template-parameter* shall not be given default arguments by two
|
| 168 |
different declarations in the same scope.
|
| 169 |
|
|
@@ -219,11 +221,11 @@ expansion shall not expand a parameter pack declared in the same
|
|
| 219 |
template <class... Types> class Tuple; // Types is a template type parameter pack
|
| 220 |
// but not a pack expansion
|
| 221 |
template <class T, int... Dims> struct multi_array; // Dims is a non-type template parameter pack
|
| 222 |
// but not a pack expansion
|
| 223 |
template<class... T> struct value_holder {
|
| 224 |
-
template<T... Values> apply { };
|
| 225 |
// and a pack expansion
|
| 226 |
};
|
| 227 |
template<class... T, T... Values> struct static_array;// error: Values expands template type parameter
|
| 228 |
// pack T within the same template parameter list
|
| 229 |
```
|
|
|
|
| 23 |
|
| 24 |
There is no semantic difference between `class` and `typename` in a
|
| 25 |
*template-parameter*. `typename` followed by an *unqualified-id* names a
|
| 26 |
template type parameter. `typename` followed by a *qualified-id* denotes
|
| 27 |
the type in a non-type [^1] *parameter-declaration*. A storage class
|
| 28 |
+
shall not be specified in a *template-parameter* declaration. Types
|
| 29 |
+
shall not be defined in a *template-parameter* declaration. A template
|
| 30 |
parameter may be a class template. For example,
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
template<class T> class myarray { /* ... */ };
|
| 34 |
|
|
|
|
| 153 |
either have a default *template-argument* supplied or be a template
|
| 154 |
parameter pack. If a *template-parameter* of a primary class template or
|
| 155 |
alias template is a template parameter pack, it shall be the last
|
| 156 |
*template-parameter*. A template parameter pack of a function template
|
| 157 |
shall not be followed by another template parameter unless that template
|
| 158 |
+
parameter can be deduced from the *parameter-type-list* of the function
|
| 159 |
+
template or has a default argument ([[temp.deduct]]).
|
| 160 |
|
| 161 |
``` cpp
|
| 162 |
template<class T1 = int, class T2> class B; // error
|
| 163 |
|
| 164 |
+
// U can be neither deduced from the parameter-type-list nor specified
|
| 165 |
+
template<class... T, class... U> void f() { } // error
|
| 166 |
+
template<class... T, class U> void g() { } // error
|
| 167 |
```
|
| 168 |
|
| 169 |
A *template-parameter* shall not be given default arguments by two
|
| 170 |
different declarations in the same scope.
|
| 171 |
|
|
|
|
| 221 |
template <class... Types> class Tuple; // Types is a template type parameter pack
|
| 222 |
// but not a pack expansion
|
| 223 |
template <class T, int... Dims> struct multi_array; // Dims is a non-type template parameter pack
|
| 224 |
// but not a pack expansion
|
| 225 |
template<class... T> struct value_holder {
|
| 226 |
+
template<T... Values> struct apply { }; // Values is a non-type template parameter pack
|
| 227 |
// and a pack expansion
|
| 228 |
};
|
| 229 |
template<class... T, T... Values> struct static_array;// error: Values expands template type parameter
|
| 230 |
// pack T within the same template parameter list
|
| 231 |
```
|