atomic::exchange Method

Uses a specified value to replace the stored value of *this.

Ty atomic<Ty>::exchange(
   Ty Value,
   memory_order Order = memory_order_seq_cst
) volatile _NOEXCEPT;
Ty atomic<Ty>::exchange(
   Ty Value,
   memory_order Order = memory_order_seq_cst
) _NOEXCEPT;

Value

A value of type Ty.

Order

A memory_order.

The stored value of *this before the exchange.

This operation performs a read-modify-write operation to use Value to replace the value that is stored in *this, within the memory constraints that are specified by Order.

Header: atomic

Namespace: std

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft