There is a clear and understandable list of contexts in which a package extension can occur at cppreference.com . What I'm trying to do is get the same information from the standard, in part, to gain experience using the standard. However, I cannot get all the package extension contexts listed on cppreference.com from the standard.
cppreference.com lists, among other things, the following four contexts: function argument lists, template argument lists, function parameter lists, and parameter parameter lists.
On the other hand, the standard says (14.5.3.4):
A package extension consists of a template and an ellipsis, which creates zero or more instances of the template in the list (described below). The shape of the template depends on the context in which the extension occurs. Package extensions can occur in the following contexts:
- In the package of function parameters (8.3.5); A template is a parameter declaration without an ellipse.
- In the template parameter package, which is an extension of the package (14.1):
- if the template parameter package is a parameter declaration; the template is a parameter declaration without an ellipse;
- if the package of template parameters is a type parameter with parameter-parameter-list; the pattern is the corresponding type parameter without an ellipse.
- ...
- In the list of argument templates (14.3); pattern is the argument of the pattern.
- ...
I cannot find out where the standard says that a package extension can occur in function argument lists. I believe this context is somehow covered by one of the three markers noted above.
Just in case, it is not clear what I mean by package extension in function argument lists, consider the following example:
template <typename ...Args> void f(Args ...args) {} template <typename ...Args> void g(Args ...args) { f(args...);
source share