A compound assignment of the form E1 op= E2 is equivalent to the simple assignment expression E1 = E1 op (E2) , except that the lvalue E1 is evaluated only once
Looking at the code, we are evaluating the lvalue twice, so things like side affecting functions on the lhs will be called twice.
From standard: 6.5.16.2 Compound assignment
Looking at the code, we are evaluating the lvalue twice, so things like side affecting functions on the lhs will be called twice.