Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

atomic::fetch_sub Method

Subtracts a specified value from the stored value.

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

Value

A value of type Ty.

Order

A memory_order.

A Ty object that contains the result of the subtraction.

The fetch_sub method performs a read-modify-write operation to atomically subtract Value from the stored value in *this, within the memory constraints that are specified by Order.

Header: atomic

Namespace: std

Show:
© 2015 Microsoft