cpp/atomic/atomic exchange

@1@ Atomically replaces the value pointed to by with the value of  and returns the value  held previously, as if by

@2@ Atomically replaces the value pointed to by with the value of  and returns the value  held previously, as if by

Return value
The value held previously by the atomic object pointed to by