I'd like to allow forward declarations of inner classes. Here is a situation I've run into where it seems that forward declaring the inner classes would allow this to work:
class Outer1; // <== potentially optional
class Outer::Inner; //<== NEW
class Outer2; // <== potentially optional
class Outer2::Inner; //<== NEW
template<class T>
class SomeClass {
// !!error: no type named 'Inner' in 'Outer1' <== clang error in current c++
typename T::Inner * some_func();
};
class Outer1 : public SomeClass<Outer1> {
public:
class Inner {
};
};
class Outer2 : public SomeClass<Outer2> {
public:
class Inner {
};
};
While there are certainly workarounds, I find this organizational structure to be useful in other languages and would have used it in c++ had it been available.
The workaround I've found is this, but the code doesn't match my intent nearly as well.
class Outer1Inner {};
class Outer1 : public SomeClass<Outer1Inner> {};
Thank you for your feedback - either on the actual proposal or on proposal procedure.
--Zac