I have a problem declaring a friend class in the following abstract code
And the error I get is "qf::class::member is protected in this context. I tried doing things likeCode:namespace qf { class Class { friend class FriendClass; protected: bool member; }; } .... void FriendClass::foo(qf::Class &cls) { cls.member = true; }
andCode:friend class ::FriendClass;
But those just gave errors or didn't work.Code:class FriendClass; namespace qf { class Class { friend class FriendClass;