0

I have some classes A and B:

struct A
{
    typedef int value_type;
};
struct B
{
    typedef float value_type;
};

I want to make a tuple of A::value_type and B::value type via variadic template. I am expecting something like this:

template<typename ...T>
struct my_tuple
{
     typedef std::tuple<T::value_type...> tuple_type;
};

This doesnt compile. How can I make such kind of tuple?

Evgeniy
  • 2,481
  • 14
  • 24

1 Answers1

1

T is a dependent name, you need to add typename. like this:

template<typename ...T>
struct my_tuple
{
     typedef std::tuple<typename T::value_type...> tuple_type;
};
WhiZTiM
  • 21,207
  • 4
  • 43
  • 68