Top "Compound-assignment" questions

For questions about single operators that assign a value based on both a previous value and an operand (e.g., the += operator in C or Python).

What exactly does += do in python?

I need to know what += does in python. It's that simple. I also would appreciate links to definitions of other …

python operators notation shorthand compound-assignment
Operator precedence with Javascript Ternary operator

I cant seem to wrap my head around the first part of this code ( += ) in combination with the ternary operator. …

javascript variable-assignment conditional-operator operator-precedence compound-assignment
Shortcut "or-assignment" (|=) operator in Java

I have a long set of comparisons to do in Java, and I'd like to know if one or more …

java assignment-operator compound-assignment or-operator
What is the difference between += and =+ C assignment operators

I was wondering if there was a difference between =+ and += (and other assignment operators too). I tried and both did …

c assignment-operator compound-assignment
Do the &= and |= operators for bool short-circuit?

When writing code like this in C++: bool allTrue = true; allTrue = allTrue && check_foo(); allTrue = allTrue && …

c++ boolean lazy-evaluation short-circuiting compound-assignment
Lua operators, why isn't +=, -= and so on defined?

This is a question I've been mildly irritated about for some time and just never got around to search the …

lua language-design assignment-operator compound-assignment
Java boolean |= operator

Recently I saw a code using this: boolean val = something(); val |= somethingElse(); Interesting part is |= (binary like) operator made on …

java operators specifications boolean-expression compound-assignment
Compound assignment and add operator overloading

I need help with both of my operator overloading functions presented below. I'm unsure of how I can implement this …

c++ string operator-overloading compound-assignment
Why are there no ||= or &&= operators in C#?

We have equivalent assignment operators for all Logical operators, Shift operators, Additive operators and all Multiplicative operators. Why did the …

c# operators language-design assignment-operator compound-assignment