W
whithers
How do I do forward declarations when namespaces are involved? For
example, given the following:
-------------------------------------ClassA.h
#ifndef CLASSA_H
#define CLASSA_H
namespace MyNameSpace
{
class A{};
};
#endif
--------------------------------------ClassB.h
#ifndef CLASSB_H
#define CLASSB_H
class A;
namespace MyNameSpace
{
class B
{
MyNameSpace::A* m_pAinst;
};
};
#endif
How do I declare A so I don't have to include the header classA.h in
classB.h
thanks
example, given the following:
-------------------------------------ClassA.h
#ifndef CLASSA_H
#define CLASSA_H
namespace MyNameSpace
{
class A{};
};
#endif
--------------------------------------ClassB.h
#ifndef CLASSB_H
#define CLASSB_H
class A;
namespace MyNameSpace
{
class B
{
MyNameSpace::A* m_pAinst;
};
};
#endif
How do I declare A so I don't have to include the header classA.h in
classB.h
thanks