Hello,
I have a compilation problem about namespaces:
I have a namespace X in which I declera a type definition:
In X.h file i write:
namespace X {
typedef unsigned int WindowHandle_t;
}
In a class which is in a different namespace ( Y ), I must use the type
definition I declared in namespace X.
MyClass.h file:
Y::MyClass {
....
private:
X::WindowHandle_t handle;
....
}
And the code doesn't compile. I should forward declare this handle type
definition but forward decleration is the same as writing the same
thing that I wrote in X.h file. When I write
In MyClass.h file :
namespace X {
typedef unsigned int WindowHandle_t;
}
Y::MyClass {
....
private:
X::WindowHandle_t handle;
....
}
The code compiles. But as I stated, I do not want to write same type
definition twice in a code. Do you have any suggestions?
Thanks...