Skip to main content

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.

To forward declare class type a in a namespace ns1:

namespace ns1
{
    class a;
}

To declare a type in multiple level of namespaces:

namespace ns1
{
  namespace ns2
  {
    //....
     namespace nsN
     {
        class a;
     }
    //....    
  }
}

Your are using a a member of ``consumer` which means it needs concrete type, your forward declaration won't work for this case.

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 which means it needs concrete type, your forward declaration won't work for this case.

added 8 characters in body
Source Link
billz
  • 45.4k
  • 9
  • 86
  • 103

To forward adeclare class type a in a namespace ns1:

namespace ns1
{
    class a;
}

To declare a type in multiple level of namespaces:

namespace ns1
{
  namespace ns2
  {
    //....
     namespace nsN
     {
        class a;
     }
    //....    
  }
}

Your are using a a member of ``consumer` which means it needs concrete type, your forward declaration won't work for this case.

To forward a type in a namespace:

namespace ns1
{
    class a;
}

Your are using a a member of ``consumer` which means it needs concrete type, your forward declaration won't work for this case.

To forward declare class type a in a namespace ns1:

namespace ns1
{
    class a;
}

To declare a type in multiple level of namespaces:

namespace ns1
{
  namespace ns2
  {
    //....
     namespace nsN
     {
        class a;
     }
    //....    
  }
}

Your are using a a member of ``consumer` which means it needs concrete type, your forward declaration won't work for this case.

Source Link
billz
  • 45.4k
  • 9
  • 86
  • 103

To forward a type in a namespace:

namespace ns1
{
    class a;
}

Your are using a a member of ``consumer` which means it needs concrete type, your forward declaration won't work for this case.