Is there any upper limit to, or maximum number of elements of Parameter packs like there is for maximum template recursion depth ?
Asked
Active
Viewed 181 times
1 Answers
2
I don't think that a separate limit is necessary. The number of elements is dictated by the site of instantiation and how many template arguments can be passed to a template:
- There is a limit of the number of arguments to a function call (recommended minimum: 256).
- There is a limit of the number of template parameters in a template declaration (recommended minimum: 1024)
The first is definitively applicable, and the second may apply if the implementation has to expand a pack into a full declaration internally. (But I do not know for sure; I do not write C++ compilers.)

j6t
- 9,150
- 1
- 15
- 35