C++ Atomic Library - store



Description

It atomically replaces the value of the atomic object with a non-atomic argument.

Declaration

Following is the declaration for std::atomic::store.

void store( T desired, std::memory_order order = std::memory_order_seq_cst );

C++11

void store( T desired, std::memory_order order = std::memory_order_seq_cst ) volatile;

Parameters

  • Desired − It is used to store the value into the atomic variable.

  • Order − It is used to enforce memory order constraints.

Return Value

(none)

Exceptions

No-noexcept − this member function never throws exceptions.

atomic.htm
Advertisements