2 ms·
Every C++ programmer knows that << is used for streaming, that is only a problem for purists or nitpickers. So you really did pick the worst common example to
by blub 8y ago
Every C++ programmer knows that << is used for streaming, that is only a problem for purists or nitpickers.
So you really did pick the worst common example to illustrate you point... A good example is how "&" is used by boost serialisation to allow both serialisation and deserialisation of a value using the same expression:
obj & value;
Now that makes no sense at first sight. Still, not even this example can be used as an argument against operator overloading, because operators are just functions with predefined names and some expected behaviour.
The above could have been called as obj.serializeOrDeserialize(value) and it wouldn't have been much better. The problem is with the programmer that can't pick proper function names (where +, -, etc are also function names).