R
REH
Can someone please tell me what is wrong with this snippet of code?
GCC is telling me that "foo2 is protected within this context" (that
I cannot use it with BBB).
class AAA {
protected:
virtual int foo2() {return 0;}
};
class BBB : public AAA {
public:
int foo(AAA& a) {return a.foo2();}
protected:
virtual int foo2() {return 1;}
};
GCC is telling me that "foo2 is protected within this context" (that
I cannot use it with BBB).
class AAA {
protected:
virtual int foo2() {return 0;}
};
class BBB : public AAA {
public:
int foo(AAA& a) {return a.foo2();}
protected:
virtual int foo2() {return 1;}
};