Export (0) Print
Expand All

atomic_exchange Function

Uses Value to replace the stored value of Atom.

template <class _Ty>
inline Ty atomic_exchange(
   volatile atomic<Ty> *_Atom,
   TyValue
) _NOEXCEPT;
template <class Ty>
inline _Ty atomic_exchange(
   atomic<Ty> *Atom,
   TyValue
) _NOEXCEPT;

Atom

A pointer to an atomic object that stores a value of type Ty.

Value

A value of type Ty.

The stored value of Atom before the exchange.

The atomic_exchange function performs a read-modify-write operation to exchange the value that is stored in Atom with Value, using the memory_order_seq_cst memory_order.

Header: atomic

Namespace: std

Show:
© 2015 Microsoft