Posted in another question:
template <class T> struct foo : T { void bar() { x = 5;
Without this->
compiler does not know that x
is an (inherited) element.
Similar to using typename
and template
inside the template code:
template <class T, class S> struct foo : T { typedef T::ttype<S>;
This is stupid and somewhat unnecessary, but you should still do it.
Pubby source share