I am trying to forward delcare this nested class, I already tried it but i didnt work. When i try to forward declare i get cant acces private member errors, so I guess i am doin
The nested type is part of the enclosing type. That means that it cannot be forward declared by itself, but it can be declared in the definition of the enclosing type, and then defined outside:
class enclosing {
class inner; // Forward declaration
};
// Somewhere else
class enclosing::inner { // Definition
int x;
};
What you cannot do is forward declare the inner type outside of the definition of the enclosing type:
class enclosing::outer; // Error