The purpose of using base<T>::foo in the function area is that you want to call foo in the function, and since it gives an error, you cannot do this.
If you want to call functon (otherwise you would do it), you can do this, which is allowed:
this->template base<T>::foo(); //syntax 1 this->base<T>::foo(); //syntax 2 - simple this->foo(); //syntax 3 - simpler
However, you cannot write this:
foo() ; //error - since foo is in base class template! //if you write `using base<T>::foo` at class scope, it will work!
Ideon Demo: http://www.ideone.com/vfDNs
Read this to know when you should use the template keyword in a function call:
Horrible template compiler errors
Nawaz
source share