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

class A
    struct B


and now I want to declare another class like this


class A;
struct A::B;

class Q
    A::B* Foo();



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.



All Articles