This is so that the operator performs more like the built-in operators. For example, if you allow some implicit conversions, then if you make operator+() a member function, the implicit converstions will only work on the RHS (right hand side).
For example: 'MyObject + 1' may compile, while '1 + MyObject' may not.
Reference: Exceptional C++
No comments:
Post a Comment