std::atomic...ad_explicit(3)
π NAME π
std::atomic_load, std::atomic_load_explicit β hey bestie, welcome to the C++ Standard Libary manual page for these atomic-load icons. This is the std::atomic_load / std::atomic_load_explicit moment, and weβre gonna understand it fr fr. π
β¨
β¨ Synopsis β¨
Defined in header <atomic>.
Here are all four overloads, labels and (since C++11) energy included β no skipping, no cap:
template< class T > (1)
(since C++11)
T atomic_load( const std::atomic<T>* obj ) noexcept;
template< class T > (2)
(since C++11)
T atomic_load( const volatile std::atomic<T>* obj ) noexcept;
template< class T >
T atomic_load_explicit( const std::atomic<T>* obj, (3)
(since C++11)
std::memory_order order ) noexcept;
template< class T >
T atomic_load_explicit( const volatile std::atomic<T>* obj, (4)
(since C++11)
std::memory_order order ) noexcept;
Okay so overloads (1) and (2) atomically obtain the value pointed to by obj as if by obj->load(). Slay. Overloads (3) and (4) atomically obtain the value pointed to by obj as if by obj->load(order). Big main-character energy. π
β οΈ undefined behavior alert, bestie: iforderis one ofstd::memory_order_releaseandstd::memory_order_acq_rel, the behavior is undefined. Not a vibe. Do not do it. ππ
π Parameters π
objβ pointer to the atomic object to modify.orderβ the memory synchronization ordering for this operation.
πΈ Return value πΈ
The value that is held by the atomic object pointed to by obj. Thatβs the whole tea. π
π¦ See also π¦
loadβ atomically obtains the value of the atomic object β public member function ofstd::atomic<T>.atomic_storeβ atomically replaces the value of the atomic object with a non-atomic argument β (C++11) (function template).atomic_store_explicitβ atomically replaces the value of the atomic object with a non-atomic argument β (C++11) (function template).memory_orderβ defines memory ordering constraints for the given atomic operation β (C++11) (enum).std::atomic_load(std::shared_ptr)β specializes atomic operations forstd::shared_ptrβ (deprecated in C++20) (removed in C++26) (function template).std::atomic_load_explicit(std::shared_ptr)β specializes atomic operations forstd::shared_ptrβ (deprecated in C++20) (removed in C++26) (function template).- C documentation for
atomic_load,atomic_load_explicitβ the C side of the story, iykyk.
source/version: http://cppreference.com Β· date: 2024.06.10 β bye bestie, go be the main character of atomic loads π
β¨π«Ά
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms