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