Given this code:
template <typename K, typename V>
class Foo{
typedef K valueTypeK;
typedef V valueTypeV;
};
template<class... Foo>
class Bar{
public:
// capture Foo... parameter package
using FooTuple = std::tuple<Foo...>;
};
template <class... Foo>
class Data{
// capture Foo... parameter package
using FooTuple = std::tuple<Foo...>;
};
// assuming T inherits from Bar
template<class T>
class Container{
// I'd like Data to be of type "Data<Foo...> "
// but it will be of type "Data<std::tuple<Foo...>>"
Data<typename T::FooTuple> data;
};
class BarImpl : public Bar<Foo<int, int>, Foo<int, float>, Foo<float, float>> {};
int main(){
BarImpl bar_impl;
Container<BarImpl> container_impl;
}
right now, in container_impl, the Data field will be of type
Data<std::tuple<Bar<Foo<int, int>, Foo<int, float>, Foo<float, float>>>
because that is how the parameter package was stored in Bar. But I want Data to be of type
Data<Bar<Foo<int, int>, Foo<int, float>, Foo<float, float>>
which would be how BarImpl was defined to begin with.
Can this be achieved somehow?
(Edit: fixed wrong var name)