To forward declare class type a
in a namespace ns1
:
namespace ns1
{
class a;
}
To forward declare a type in multiple level of namespaces:
namespace ns1
{
namespace ns2
{
//....
namespace nsN
{
class a;
}
//....
}
}
Your are using a
a member of ``consumer`consumer
which means it needs concrete type, your forward declaration won't work for this case.