Forwarding a declared class member

Is it possible to forward-declare a class that is declared in another forward-declared class?

Basically, I have something like this

//A.h
class A
{
...
    struct B
    {
    ...
    };
};

      

and now I want to declare another class like this

//Q.h

class A;
struct A::B;

class Q
{
    A::B* Foo();
};

      

+3


source to share


1 answer


No, It is Immpossible. To access members A

, it must be defined regardless of whether the member is a type, data, or function.



+4


source







All Articles