There is a difference between h = ++i
and h = i++
in C#. So what I need is a way to declare different overloaded operators for pre-increment (i.e. ++i) and post-increment (i++) in C#. How would I do that please?
I am aware of the fact that both operators do the same to the value they work on - the problem is the point of time when the assignment is done. I know how to do it in C++, but that is not the question. I am wondering whether there is a way to overload both ways this operator can behave in C#, and if so, how to do it.