The assignment operator can be overloaded using a member function but not a non-member friend function:
friend
class Test { int a; public: Test
Why friend function can't be used for overloading assignment operator?
Short answer: Just because.
Somewhat longer answer: That's the way the syntax was fixed. A few operators have to be member functions. The assignment operator is one of the,