I have the following simple code:
template <typename T>
struct base
{
std::vector<T> x;
};
template <typename T>
struct derived : base<T>
{
void print()
{
using base<T>::x; // error: base<T> is not a namespace
std::cout << x << std::endl;
}
};
When I compile the code (using GCC-4.7.2) I get the error that you see in the comment above.
I read here: http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Name-lookup.html#Name-lookup that
using base<T>::x
has to be included in order to bring in the scope of the base class. Any ideas what is wrong? Thank you in advance!