What\'s the best solution to forward declare a typedef within a class. Here\'s an example of what I need to solve:
class A;
class B;
class A
{
typedef boos
You cannot.
But you can decouple the Ptr definition of the classes:
class A;
class B;
template
struct Traits {
typedef std::shared_ptr Ptr;
};
class A
{
Traits::Ptr foo();
};
class B
{
Traits::Ptr bar();
};
If A and B does not share the same types, you always can specialize Traits for all type.