R
Ronald Raygun
I have the class declared like this in the header fiel:
//header
class MyClass
{
public:
MyClass();
MyClass(const MyClass&);
MyClass& operator=(const MyClass&);
~MyClass();
friend int MyFriendFunc(const MyClass&);
private:
int m_i ;
};
//source
namespace
{
void MyFriendFunc(const MyClass& mc){ return mc.m_i++ ;}
}
//MyClass impl ...
I get compiltion errors (MyFriendFunc cannot access private member of
MyClass ...
using the ns resolution operator does not seem to work either:
friend int ::MyFriendFunc(const MyClass&);
//header
class MyClass
{
public:
MyClass();
MyClass(const MyClass&);
MyClass& operator=(const MyClass&);
~MyClass();
friend int MyFriendFunc(const MyClass&);
private:
int m_i ;
};
//source
namespace
{
void MyFriendFunc(const MyClass& mc){ return mc.m_i++ ;}
}
//MyClass impl ...
I get compiltion errors (MyFriendFunc cannot access private member of
MyClass ...
using the ns resolution operator does not seem to work either:
friend int ::MyFriendFunc(const MyClass&);