Valid Overloadable Operators : operator overload « Operator Overload « C# / CSharp Tutorial






C# Operator                                    Overloadability

+, -, !, ~, ++, --, true, false                This set of unary operators can be overloaded.

+, -, *, /, %, &, |, ^, <<, >>                 These binary operators can be overloaded.

==, !=, <, >, <=, >=                           The comparison operators can be overloaded. 

[]                                             The [] operator cannot be overloaded. 

()                                             The () operator cannot be overloaded. 

+=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=       Shorthand assignment operators cannot be overloaded.








8.1.operator overload
8.1.1.Valid Overloadable Operators
8.1.2.Operator Overloading: A Complex Number Class
8.1.3.Operator Overloading for your own class
8.1.4.A better way to overload !, |, and & for TwoDimension.