Hi every body,
It said that standard C++ says nondependent names are not looked up in dependent base classes,in c++ template 9.4.2..
But there is no diffrence between 'this->basefield' and ‘basefield without this’,in MS vs 2008.They both can find the name of basefield in dependent base classe--Base ,Why?
It said that standard C++ says nondependent names are not looked up in dependent base classes,in c++ template 9.4.2..
Code:
template<typename X>
class Base{
public:
int basefield;
typedef int T;
};
template <typename T>
class DD:Base<T>{
public:
void f(){
basefield = 0;//problem??
this->basefield = 0;//ok
cout<<basefield<<endl;
}
};
Comment