C++ allows to overload = operator only as a member function not as a global function.
Bruce Eckel says that if it was possible to define operator= globally, then you might attempt to redefine the built-in = sign. and due to this reason you can overload = operator only as a member function.
if C++ has already defined = operator then why the other operators like + - etc… are not defined by C++ as they can be overloaded as a non-member function. ?
The compiler generates a default copy assignment operator (operator=) for all classes that do not define their own. That means that a global overload won’t be selected under any circumstances.