Hello Group!
The standard states -- 29.6.5-32 -- that for a std::atomic
type, "C A::operator op=(M operand);"
Returns: fetch_key(operand) op operand
That is, the return value is, as one would expect, the
result of performing the operation.
(I am looking at the N3242 draft standard, pg. 1127.)
cplusplus.com has in their atomics reference section:
http://www.cplusplus.com/reference/atomic/atomic/operatororequal/
Each of this functions accesses the contained value, apply
the proper operator and return the value the contained value
had immediately before the operation
and
Return value
The contained value before the call.
So, they have it backwards (as if they were describing
post-increment, rather than pre-increment semantics).
Happy Hacking!
K. Frank