Possible Duplicate:
C++ inheritance - inaccessible base?
Why does the compiler select the base class constructor inside the template argument list?
class InterfaceA
{
public:
virtual void f () = 0;
};
class A :
private InterfaceA
{
public:
void f () {}
};
class B :
public A
{
private:
/*::*/InterfaceA * m_a; // Adding "::" makes it work
};
GCC and VS2008 say ‘class InterfaceA’ is inaccessible
. If i declare m_a
with explicit global scope everything compiles fine.
upd: m_a
is a pointer
, not an object itself. In fact the question why can't i declare a pointer
and why adding "::" solves this problem?