On May 13, 2020, at 7:00 PM,Dave Horsfall
<dave(a)horsfall.org> wrote:
I never could figure out why Stroustrup implemented that "feature"; let's
see, this operator usually means this, except when you use it in that
situation in which case it means something else. Now, try debugging that.
C continues the tradition begun by Fortran and Algol 60 of overloading the arithmetic
operators on the various numeric types. C++ allows new types to be defined; when a new
type obeys the generally understood properties of a built-in type, it makes sense to use
the same operator (or function) for the corresponding operation on the new type (e.g.,
addition on complex numbers, arbitrary-precision integers and rationals, polynomials, or
matrices).