F
for.fun
Hi everybody,
I have the following problem :
B class need A::MyEnum type and A class need B::MyEnum type.
In both case, the class type is incomplete so it is obvious that the
::MyEnum can not be found in the class definition (the compiler
complains)
My problem is the MyEnum types have to be defined inside the class
scopes.
=> Do you know a way to solve this problem (keeping the types inside
the classes) ?
Thanks in advance.
Here is a simple source illustrating my problem :
---------------------------------------
#include "B.h"
class B;
class A
{
public: A(B::MyEnum);
typedef MyEnum { red, pink, blue };
};
---------------------------------------
#include "A.h"
class A;
class B
{
public: B(A::MyEnum);
typedef MyEnum { one, two, three };
};
I have the following problem :
B class need A::MyEnum type and A class need B::MyEnum type.
In both case, the class type is incomplete so it is obvious that the
::MyEnum can not be found in the class definition (the compiler
complains)
My problem is the MyEnum types have to be defined inside the class
scopes.
=> Do you know a way to solve this problem (keeping the types inside
the classes) ?
Thanks in advance.
Here is a simple source illustrating my problem :
---------------------------------------
#include "B.h"
class B;
class A
{
public: A(B::MyEnum);
typedef MyEnum { red, pink, blue };
};
---------------------------------------
#include "A.h"
class A;
class B
{
public: B(A::MyEnum);
typedef MyEnum { one, two, three };
};