
31 Aug
2011
31 Aug
'11
5:02 p.m.
On Aug 31, 2011, at 12:47 PM, Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
The rule I follow is that operator+(x, x) can be provided only by the author of x. If xdoesn't have such operator, third parties can't add one. The same applies to swap and other functions that are expected to be found by ADL and form the type's interface.
If you were defining operator+(X,Y) you'd have the same problem. Any customization point involving two or more types seems to suffer this problem. Cheers Gordon