I have code similar to the following:
class B
{
}
class A
{
enum {
EOne,
ETwo
} EMyEnum;
B myB;
}
I want to declare a member of type EMyEnum in class B (which is declared before A). Is this possible? I realise the solution is to declare class B second, but for clarity I would prefer not to.
It’s not possible… but it can be faked with inheritance abuse 🙂
On the other hand… why don’t you simply forward declare B ?
Sure you need to actually write all the normally “default generated” methods of A, but hey that does not cost so much!