The value of an expression with a compound assignment operator is the value of the left operand after assignment. So the code you showed is valid. Moreover, in C ++ (opposite to C), the result is lvalue. So you can even write :)
arr.push_back( ++( a *= b ) );
In this case, the following statement outputs 16. :)
source
share