Unfortunately, this does not do what you think it does. This uses private inheritance, which would make all members in Base inaccessible because they're all inherited as private members.
The compiler is trying to call an operator in Base, but fails due to that it's private in the derived class. The following demonstrates that it's private inheritance:
Code:
class CBase
{
public:
CBase() { }
void myfunc() { }
};
class CDerived: CBase
{
public:
CDerived() { }
};
int main()
{
CDerived d;
d.myfunc();
return 0;
}
This gives the compile error:
Error 1 error C2247: 'CBase::myfunc' not accessible because 'CDerived' uses 'private' to inherit from 'CBase' g:\w00t\visual studio 2008\projects\test\test.cpp 17
Now, if you change it to
Code:
class CDerived: public CBase
It will compile fine.