Operator overloading
All operator in Hades can be overloaded. The syntax for this is similar to overloading an inherited function. Operator overloading in Hades always assumes a right operation so the base for the operation is always the parameter on the left.
Example
Index operator overloading
One special case of operator overloading is when you want to overload the index operator []
.
There are two functions that can be overwritten:
reading from an index:
index(args indices)
writing to an index:
index(args indicies, newValue)
Example
Last updated