Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::atomic_ref<T>::load

Atomically loads and returns the current value of the referenced object. Memory is affected according to the value of order.

NotebookLM
value_type load( std::memory_order order =
                     std::memory_order_seq_cst ) const noexcept;
(constexpr since C++26)

Atomically loads and returns the current value of the referenced object. Memory is affected according to the value of order.

If order is not std::memory_order_relaxed, std::memory_order_consume, std::memory_order_acquire or std::memory_order_seq_cst, the behavior is undefined.

Parameters

order - memory order constraints to enforce

Return value

The current value of the referenced object.

See also

loads a value from the referenced object
(public member function)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.