I would like to enforce that all types in a parameter pack have a nested type alias declared in them (T
), and expand all the T
's of the types into a tuple
. Is something like this possible? When I try the naiive way below, it doesn't recognize Types::T
as a type.
class A { using T = int; };
class B { using T = double; };
template<class ... Types>
class C {
using tuple_of_types_t = std::tuple<Types...>; // of course this works
using tuple_of_nested_types_t = std::tuple<((Types::T),...)>; // how do I achieve this?
};