3 ms·
OP writes: "Of course, there are more operators that can be overloaded, such as * or /, but I find that even strong advocates of operator overloading quickly ru
by frossie 18y ago
OP writes: "Of course, there are more operators that can be overloaded, such as * or /, but I find that even strong advocates of operator overloading quickly run short of arguments when trying to justify why one would even want to overload them outside of specific algebras."
Isn't that like saying "Why would you ever want a red light outside of an intersection"? I wouldn't, but that doesn't mean I want to do without red lights.
Specific algebras (if by that he means matrices, quantities that carry error quantities with them etc) are powerful and elegant ways of addressing problems and are extremely suited to operator overloading (eg. see the Perl Data Language).
Personally I have never seen + overloaded without the rest of the arithmetic operators being overloaded too, so my experience is sufficiently different that may be entirely missing the point.