That doesn't matter. By trying to return the 'va_' member variable, the compiler needs to know the declaration of the class. Try it this way:
ViggyCode:class A; class B{ public: int getValue(A* pa); }; class A { friend int B::getValue(A* pa); public: A():va_(1){} private: int va_; }; inline int B::getValue(A* pa) { return pa->va_; }




Reply With Quote