On Tuesday, 2 July 2013 at 21:48:54 UTC, Walter Bright wrote:
On 7/2/2013 1:47 PM, TommiT wrote:
Division operator for strings doesn't make any sense,

That's why overloading / to do something completely unrelated to division is anti-ethical to writing understandable code. The classic example of this is the overloading of << and >> for stream operations in C++.

I've never thought of it like that. At some point I remember writing a vector type which overloaded its binary * operator to mean dot product (or cross product, I can't remember). So, you can overload an operator, but you can't overload the meaning of an operator.

Reply via email to