For example, I could do:
class MyClass {int operator+(int a) { return a; }}; MyClass x; x + 1; // Valid. 1 + x; // Type error.
= -> [] ()
For example, I could do:
EDIT: My mistake. C++ requires these operators to be nonstatic member functions: Which, annoyingly enough, means that you can define '+' over types that you haven't implemented, but you can't define [] or =.