I have a class like this:
#include <tuple>
// Models is supposed to be a tuple<class... Classes>
template<class Models>
class MyClass
{
std::tuple<
std::tuple_element<0,Models>::type::NestedType,
std::tuple_element<1,Models>::type::NestedType,
std::tuple_element<2,Models>::type::NestedType
> nestedTypedTuple;
};
Currently nestedTypedTuple
is of fixed size of 3 elements, which is too small for larger-sized Models
and won't work at all for smaller-sized Models
. I'd like to define it in a more generic way, so that its declaration worked for any number of elements in Models
. It seems using the ways given here for iterating over tuple won't work because I need to derive a type, not call a function here.
What would be a working approach?