Template parameters and template arguments

1 Template parameters 1.1 Non-type template parameter 1.2 Type template parameter 1.3 Template template parameter 1.4 Name resolution for template parameters

# Notes

In template parameters, type constraints could be used for both type and non-type parameters, depending on whether auto is present.

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 150(P0522R0)C++98template-template arguments had to match parameterlists of template-template parameters exactlymore specializedalso allowed
CWG 184C++98whether the template parameters of template templateparameters are allowed to have default arguments is unspecifiedspecification added
CWG 354C++98null pointer values could not be non-type template argumentsallowed
CWG 1398C++11template non-type arguments could not have type std::nullptr_tallowed
CWG 1570C++98template non-type arguments could designate addresses of subobjectsnot allowed
CWG 1922C++98it was unclear whether a class template whose name is aninjected-class-name can use the default arguments in prior declarationsallowed
CWG 2032C++14for variable templates, there was no restriction on the templateparameters after a template parameter with a default argumentapply the same restrictionas on class templatesand alias templates
CWG 2542C++20it was unclear whether the closure type is structuralit is not structural
CWG 2845C++20the closure type was not structuralit is structuralif capture-less
P2308R1C++11C++201. list-initialization was not allowed for non-type template arguments (C++11)2. it was unclear how non-type template parameters of class types are initialized (C++20)1. allowed2. made clear