If I use a chain of inheritance like the following example I could use vars from the deepest base without any problems:
class A { public: int x; };
class B : public A { };
class C: public B { public: void Do() { cout << x << endl; } };
If I do the same with recursive variadic template classes I could not access my vars. Any idea how to access the vars and why I could not see my vars?
template <class ...Parms>
class Example;
template <class Head, class ...Parms>
class Example<Head, Parms...>: public Example<Parms...>
{
};
template <>
class Example<>
{
public:
int x;
};
template <class ...Parms>
class Last: public Example<Parms...>
{
void Do() { cout << x << endl; }
};
Compile fails before any instance of the class is instantiated!