Search code examples
c++c++17parameter-pack

Does parameter packs carry a set limit?


Is there any upper limit to, or maximum number of elements of Parameter packs like there is for maximum template recursion depth ?


Solution

  • 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:

    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.)