...and overloaded operators
Here you expect the “ + ” operator to add the 2 numbers, but of course “adding two integers” is quite different from “adding two real numbers”.
This is a trivial overloaded operator.
Wouldn’t it be nice to define some of the following:
- Matrix + Matrix, and int + Matrix
- Matrix * Matrix, and int * Matrix, as well as Matrix * int
- color * color might not be a good metric - but who knows.
In C++, you can actually do that!