0

I'd like to be able to declare a class with a template pack, such that the class itself will have a member variable tuple that wraps each of the template pack members in a container type of some sort. A basic goal would look like:

template <typename Types...>
class VectorOfMembers 
{
public:
    // Member tuple where each element is expanded in a container
    std::tuple<std::vector<Type[1]>, std::vector<Type[2]>, std::vector<TypeN...>>
};

Ideally I'd like to be able to do this with any templated object as the wrapping type too.

MrBZapp
  • 109
  • 7

1 Answers1

7

Well, you almost had it:

template <typename... Types>
class VectorOfMembers
{
public:
    // Member tuple where each element is expanded in a container
    std::tuple<std::vector<Types>...> tuple;
};
Rakete1111
  • 47,013
  • 16
  • 123
  • 162