Rationale of enforcing some operators to be members

Viewed 1726

There are 4 operators in C++ which can be overloaded but cannot be overloaded as freestanding (aka nonmember, standalone) functions. These operators are:

  • operator =
  • operator ()
  • operator ->
  • operator []

This thread explains perfectly well the rationale behind prohibiting operator = to be a nonmember function. Any ideas about the other three?

2 Answers
Related