Basically, I have some typedefs in class A that I would like to use in another class B. However, class B contains an instance of A (technically class C deriving from A), so I obviously can't include B in A to get it to work. What should I do here?
class test{
protected:
typedefint* iptr;
public:
iptr tst;
};
or are they just in the same file?
If the case is the latter (which would make more sense to me) then you could simply make another header file with the typedef(s) in it, and include said header in both other headers (I would think)
unless of course you are making a typedef of the class...
class A;
class B;
template <class T>
struct Traits;
template<>
struct Traits<A>
{
typedefchar ElemType;
};
class B
{
Traits<A>::ElemType elem1;
};
class A
{
Traits<A>::ElemType elem2;
B b;
};