I have this class that compiles in VC14, but when I try to compile in gcc 4.8.5, it doesn't work, I get "error: C was not declared in this scope".
class A
{
};
class B : public A
{
friend class C;
friend class D;
private:
class BB
{
std::list<C> c;
std::list<D> d;
};
};
class C : public B::BB
{
};
class D : public B::BB
{
};
I tried to forward declare "class C" before the definition of class B, but it gives me an error because it doesn't have the same definition as "class C : public B::BB", and I can't put that definition because BB is private... I'm not sure what to do.
Thanks