Files
2025-10-25 03:02:53 +03:00

3.7 KiB

[temp.decls.general]

13 Templates [temp]

13.7 Template declarations [temp.decls]

13.7.1 General [temp.decls.general]

1

#

The template parameters of a template are specified in the angle bracket enclosed list that immediately follows the keyword template.

2

#

A primary template declaration is one in which the name of the template is not followed by a template-argument-list.

The template argument list of a primary template is the template argument list of its template-head ([temp.arg]).

A template declaration in which the name of the template is followed by a template-argument-list is a partial specialization ([temp.spec.partial]) of the template named in the declaration, which shall be a class or variable template.

3

#

For purposes of name lookup and instantiation, default arguments,type-constraints,requires-clauses ([temp.pre]), andnoexcept-specifiers of function templates and of member functions of class templates are considered definitions; each default argument,type-constraint,requires-clause, ornoexcept-specifier is a separate definition which is unrelated to the templated function definition or to any other default arguments,type-constraints,requires-clauses, ornoexcept-specifiers.

For the purpose of instantiation, the substatements of aconstexpr if statement are considered definitions.

For the purpose of name lookup and instantiation, the compound-statement of an expansion-statement is considered a template definition.

4

#

Because an alias-declaration cannot declare atemplate-id, it is not possible to partially or explicitly specialize an alias template.