Fumitoshi UKAI <[EMAIL PROTECTED]> writes: > Hmm, maybe this would be what the upstream auther wants.
It's hard to know what upstream wants given a bug in the compiler and a bug in the code. I think ns::operator+ would work just as well as ::operator+ due to argument-dependent name lookup ("koenig lookup"). > I tried this and it seems that __GNUC__ >= 4 would be required > for friend line. If ns::operator+ is OK then the following should work with gcc-3 and gcc-4: namespace ns { class A; A operator+(const A& x, const A& y); }; class ns::A { public: A(int j) { i = j; }; private: int i; friend A ns::operator+(const A& x, const A& y); }; using namespace ns; A ns::operator+(const A& x, const A& y) { return A(x.i + y.i); } However if this is code within a library then switching from ::operator+ to ns::operator+ would be an ABI change. -- Philip Martin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]