: Retrieves the value in expected.
It then atomically
compares the value representation of the value pointed to by this
for equality with that previously retrieved from expected
and if true, replaces the value pointed to
with that in desired.
If and only if the comparison is true
, memory is affected according to the
value of success
, and if the comparison is false, memory is affected according
to the value of failure.
When only one memory_order
supplied, the value of success
, and the value of
except that a value of memory_order::acq_rel
shall be replaced by the value memory_order::acquire
and a value of
shall be replaced by the value
If and only if the comparison is false then, after the atomic operation,
the value in expected
is replaced by the value
pointed to by this
during the atomic comparison.
If the operation returns true
operations are atomic read-modify-write
) on the memory
pointed to by this.
Otherwise, these operations are atomic load operations on that memory.