dimanche 18 novembre 2018

Transform parameter pack types

I have multiple classes which share the same public typedefs like

struct A { using Container = std::array<A>; };
struct B { using Container = std::vector<B>; };
struct C { using Container = std::array<C>; };

Now I have a class which gets a parameter pack containing only valid classes but it has to store a tuple of the containers. Pseudo-code:

template <typename... Modules>
struct Collector
{
std::tuple<Modules...::Container> mContainers;
};

Is there an elegant way to apply the ::Container during unpacking?

Aucun commentaire:

Enregistrer un commentaire