Short circuit on |= and &= assignment operators in C#

后端 未结 3 1468
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 10:09

I know that || and && are defined as short-circuit operators in C#, and such behaviour is guaranteed by the language specification, but do

3条回答
  •  野性不改
    2020-11-30 10:09

    but do |= and &= short-circuit too?

    No. &= and |= are the equivalents of the operations & and |, not of the short-circuited logical operators.

提交回复
热议问题