[temp.decls.general] (original) (raw)
13 Templates [temp]
13.7 Template declarations [temp.decls]
13.7.1 General [temp.decls.general]
Atemplate-id, that is, thetemplate-namefollowed by atemplate-argument-listshall 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_]
For purposes of name lookup and instantiation, default arguments,type-constraints,requires-clauses ([temp.pre]), andnoexcept-specifier_s_of function templates and of member functions of class templates are considered definitions; each default argument,type-constraint,requires-clause, ornoexcept-specifieris a separate definition which is unrelated to the templated function definition or to any other default argumentstype-constraints,requires-clauses, ornoexcept-specifiers.
For the purpose of instantiation, the substatements of aconstexpr if statement are considered definitions.
Because an alias-declaration cannot declare atemplate-id, it is not possible to partially or explicitly specialize an alias template.