Operator Mangling
Operators also require some form of mangling to allow overloading them in user defined types. Ferrous simply looks up operators by their symbol and retrieves their mangled name from an enum.
Every operator function in Ferrous
uses the fe.op.
prefix to uniquely identify them without colliding with
the user definable identifier range.
The following lists contain all valid overloadable operators in Ferrous:
Symbol |
Name |
Mangled Name |
---|---|---|
|
Plus |
|
|
Minus |
|
|
Times |
|
|
Divide |
|
|
Modulo |
|
|
Saturating Plus |
|
|
Saturating Minus |
|
|
Saturating Times |
|
|
Saturating Divide |
|
|
Saturating Modulo |
|
|
Plus Assign |
|
|
Minus Assign |
|
|
Times Assign |
|
|
Divide Assign |
|
|
Modulo Assign |
|
|
Saturating Plus Assign |
|
|
Saturating Minus Assign |
|
|
Saturating Times Assign |
|
|
Saturating Divide Assign |
|
|
Saturating Modulo Assign |
|
|
Bitwise AND |
|
|
Short Circuit AND |
|
|
Bitwise OR |
|
|
Short Circuit OR |
|
|
Bitwise XOR |
|
|
Left Shift |
|
|
Right Shift |
|
|
Bitwise Inverse |
|
|
Bitwise AND Assign |
|
|
Bitwise OR Assign |
|
|
Bitwise XOR Assign |
|
|
Left Shift Assign |
|
|
Right Shift Assign |
|
|
Bitwise Pre-Inverse Assign |
|
|
Bitwise Post-Inverse Assign |
|