mardi 11 avril 2023

Using a variadic template template, itself with with variadic parameters?

Could one make a variadic template template, itself with variadic parameters?
How would one explicitly/partially specialize this template?

//E.g. something where the following would be valid:

template <template <typename...> typename... Containers>
    class SomeClass {};

SomeClass <int, std::vector<int>, std::tuple<int, char, float, double, short>> var;

I get as far as

template <template <typename...> typename... Tuples>
    class CVarMap : public CVarMap<Tuples>
    {};

template <template <typename...> typename Tuple, template <typename...> typename... Tuples>
    class CVarMap : public CVarMap<Tuple, Tuples...>
    {};

but any attempt to unpack the "inner" variadic args results in a template with multiple variadic parameters. Yet in the answer for this question there are multiple variadic parameters, which is valid.

What am I missing here?

Aucun commentaire:

Enregistrer un commentaire