Monday 15 February 2016

Operator overloading operators in C#

What we could use are:

 Unary operators
 +, -, !, ~, ++, --, true, false
 Binary operators
 +, -, *, /, %, &, |, ^, <<, >>
 Comparison operators
 ==, !=, <, >, <=, >=

 What we can't use are:
 conditional logical operators
 &&, ||
 array indexing operator
 []
 cast operator
 ()
 Assignment operators
 +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=
 Extra
 =, ., ?:, ->, new, is, sizeof, typeof