1

Probably duplicate though I couldn't find a reference.

Similar quotation had been asked: Short circuit on |= and &= assignment operators in C# for a different language

bitwise-and-assign

Full syntax

bool bRes;
bRes = bRes & SomeFunc()

Syntactic sugar

bool bRes;
bRes &= SomeFunc()

short-circuit-and-assign

Full syntax

bool bRes;
bRes = bRes && SomeFunc()

Syntactic sugar

bool bRes;
???

Question

Is there a syntactic sugar for short-circuit-and-assign?

Community
  • 1
  • 1
idanshmu
  • 4,621
  • 4
  • 39
  • 81

0 Answers0