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
There is no such thing as forward declaring a typedef
unfortunately. However, there's a trick using late template instantiation:
template class BImpl;
template
class AImpl
{
public:
typedef boost::shared_ptr Ptr;
typename BImpl::Ptr foo();
};
template
class BImpl
{
public:
typedef boost::shared_ptr Ptr;
typename AImpl::Ptr bar();
};
typedef AImpl A;
typedef BImpl B;
This should hopefully accomplish the thing you're aiming for.