Original Post
I'm trying to define nested classes with this basic structure: How can I make Outer aware of the declaration of Inner::X without first defining Inner? (The point of this design, by the way, is that Inner::X grants finer-grained access to Outer than C++ natively allows. For the sake of namespace tidiness, I am loathe to make Inner::X a top-level class so I can forward-declare it. Is what I'm trying to do actually impossible?
class Outer {
public:
class Inner; // OK
class Inner::X; // Not OK
private:
friend class Inner::X;
// Stuff
};
class Outer::Inner {
public:
class X {
// Stuff
};
// Stuff
};