13
Templates
[temp]
13.7
Template declarations
[temp.decls]
13.7.1
General
[temp.decls.general]
1
#
A
template-id
, that is, the
template-name
followed by a
template-argument-list
shall not be specified in the declaration of a primary template declaration
.
[
Example
1
:
template
<
class
T1,
class
T2,
int
I
>
class
A
<
T1, T2, I
>
{
}
;
// error
template
<
class
T1,
int
I
>
void
sort
<
T1, I
>
(
T1 data
[
I
]
)
;
// error
—
end example
]
[
Note
1
:
However, this syntax is allowed in
class template partial specializations
.
—
end note
]
2
#
For purposes of name lookup and instantiation, default arguments,
type-constraint
s
,
requires-clause
s
(
[temp.
pre]
), and
noexcept-specifier
s
of function templates and of member functions of class templates are considered definitions; each default argument,
type-constraint
,
requires-clause
, or
noexcept-specifier
is a separate definition which is unrelated to the templated function definition or to any other default arguments
type-constraint
s
,
requires-clause
s
, or
noexcept-specifier
s
.
For the purpose of instantiation, the substatements of a
constexpr if
statement are considered definitions
.
3
#
Because an
alias-declaration
cannot declare a
template-id
, it is not possible to partially or explicitly specialize an alias template
.