Most (but I actually know a small number, so let's not understand this point). High-level languages support several different assignment operators.
a += 5;
But none (which I looked over (again a small number)) seems to support the && = operator. The reason I ask, I recently saw this:
// simplified. bool x = false; x = x && testA(); // perform test A/B/C/D stop on first failure. x = x && testB(); x = x && testC(); x = x && testD();
And I was wondering why we could not use:
x &&= testA(); // perform test A/B/C/D stop on first failure. x &&= testB(); x &&= testC(); x &&= testD();
The reason is that && = is not supported in C / C ++, which made us think why.
Is there a logical (no pun intended) reason why the language supports all other basic operators with the destination form, but not with & = or || =
I have a vague recollection of the argument against them, but google and SO searches are difficult when your search query is "& & =", and as a result I did not find anything.
source share