Why can't access parent attributes if I use template parameters as parent template arguments?
It's difficult to formulate this question, in its simplest form, why the following snippet does not compile? Is there any way to make this thing work? what am I doing wrong?
template<typename T>
struct Str{ T x; };
template<typename T>
class Cls : public Str<T>{
Cls(){
x = 0; // Error: 'x' was not declared in this scope
}
};
Thank you in advance
Aucun commentaire:
Enregistrer un commentaire