Wrap each type in a variation template in a template class

Given the variational pattern Types... , I would like to save A<> for each of the types in the package. This can be done in the tuple A<> , but I will need to programmatically get the type of the specified tuple.

Is this possible, even in C ++ 11/14/17?

 template <class T> class A { }; template <class... Types> class B { // A tuple of A<> for each type in Types... std::tuple<A<Type1>, A<Type2>, ...> data; }; 
+5
source share
1 answer

Just using

 template <class... Types> class B { std::tuple<A<Types>...> data; }; 
+12
source

All Articles