In what way can I express that each parameter in a parameter pack to a variadic template is itself a parameter pack?
Consider this code:
template <typename... TS>
void use_tuple(std::tuple<TS...> arg0);
template <typename... TS0, typename... TS1>
void use_tuple(std::tuple<TS0...> arg0, std::tuple<TS1...> arg1);
I want use_tuple to be able to take any number of tuples. Right now I have to write it like this:
template <typename... TS0, typename... REST>
void use_tuple(std::tuple<TS0...> arg0, REST... rest);
void use_tuple(); // Terminates the recursion.
But I want to write it like this:
// Each ELEMENT in PACK_OF_PACKS is a parameter pack.
template <(typename...)... PACK_OF_PACKS>
void use_tuple(std::tuple<PACK_OF_PACKS...>... args);
Is this even possible? If so, how? If not, what else can I do? My goal for this code is to get at the types contained in all the tuples.
My ultimate goal is something like this:
template <typename...> void foo();
use_tuple(std::tuple<int, float, char>{},
std::tuple<double, short, std::string>{},
std::tuple<std::function<void()>, std::vector<int>>{});
// Results in a call to
// foo<int, float, char, double, short, std::string,
// std::function<void()>, std::vector<int>>();
But I want to implement this in a small, constant number of indirections that does not depend on the number of tuples passed or the number of elements in each. So no recursion.