Rage Against The Machine* once covered a musing about smooth operators operating correctly.

Operators operating correctly

Here we are going to cover overloading operators and getting them to operate as correctly and smoothly as possible.

What is operator overloading?

An operator is like a plus sign or a “greater than” sign. You typically think of them in expressions like 1 + 1 or 3 > 2. The operator operates on one or two operands. Most vanilla cases involve using numbers and the language already supports that. Even String is somewhat supported:

val newString = "effec" + "t" // results in…

About

Rob Gulley

dog farmer, coder

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store