I know that the &&
operator and ||
operators are short-circuited in c#.
But are the &=
operators and |=
operators as well?
Suppose I have a statement:
bool a = doSomething();
a &= doNext();
Is this guaranteed to be equivalent to:
bool a = doSomething();
if(!a)
a = doNext();
I imagine that would actually be equivalent to:
a = a & doNext()
Google for bitwise operations to see more.