Function one() accepts one parameter pack. Function two() accepts two. Each pack is constrained to be wrapped in types A and B. Why is it
Function templates (like skypjack's example) and partial specializations of class and variable templates can have multiple parameter packs if each template parameter subsequent to a template parameter pack either has a default value or can be deduced. The only thing I'd like to add/point out is that for class and variable templates you need a partial specialization. (See: C++ Templates, The Complete Guide, Vandevoorde, Josuttis, Gregor 12.2.4, Second Edition)
// A template to hold a parameter pack
template < typename... >
struct Typelist {};
// Declaration of a template
template< typename TypeListOne
, typename TypeListTwo
>
struct SomeStruct;
// Specialization of template with multiple parameter packs
template< typename... TypesOne
, typename... TypesTwo
>
struct SomeStruct< Typelist < TypesOne... >
, Typelist < TypesTwo... >
>
{
// Can use TypesOne... and TypesTwo... how ever
// you want here. For example:
typedef std::tuple< TypesOne... > TupleTypeOne;
typedef std::tuple< TypesTwo... > TupleTypeTwo;
};