cpp/atomic/atomic compare exchange

Atomically compares the of the object pointed to by  with that of the object pointed to by, and if those are bitwise-equal, replaces the former with  (performs read-modify-write operation). Otherwise, loads the actual value pointed to by into  (performs load operation). Copying is performed as if by std.

The memory models for the read-modify-write and load operations are and  respectively. The (1-2) versions use std by default.

These functions are defined in terms of member functions of std:

@1@ @2@ @3@ @4@

Return value
The result of the comparison: if  was equal to,  otherwise.