inherted from a template class

Here are two template class.
template<class T>
class A{
protected:
T _data;
};
template<class T>
class B:public A<T>{
B(T data){_data=data;}
};
However, gcc the compiler complained
In constructor ‘B<T>::B(T)’:
error: ‘_data’ was not declared in this scope.

But In microsoft VS c++ compiler. It can pass. Anything wrong here? Thank you.

Last edited on
you have to inherit A<T> or A<Whatever you want>
This question has been asked before and answered here:
http://www.cplusplus.com/forum/general/16398/
Topic archived. No new replies allowed.