std::atomic...re_explicit(3)
π«Ά std::atomic...re_explicit(3) β C++ Standard Libary π«Ά
okay so bestie, we are in the C++ Standard Libary manual (yes, that is literally how the header spells it, not me π), and this page is all about std::atomic_store and std::atomic_store_explicit. The manual name is std::atomic...re_explicit(3), and we are about to get so familiar with these atomic store girlies. π
β¨ NAME β¨
std::atomic_store,std::atomic_store_explicit - std::atomic_store,std::atomic_store_explicit
πΈ Synopsis πΈ
Defined in header <atomic>
(1)(since C++11)
template< class T >
void atomic_store( std::atomic<T>* obj,
typename std::atomic<T>::value_type desired ) noexcept;
(2)(since C++11)
template< class T >
void atomic_store( volatile std::atomic<T>* obj,
typename std::atomic<T>::value_type desired ) noexcept;
(3)(since C++11)
template< class T >
void atomic_store_explicit( std::atomic<T>* obj,
typename std::atomic<T>::value_type desired,
std::memory_order order ) noexcept;
(4)(since C++11)
template< class T >
void atomic_store_explicit( volatile std::atomic<T>* obj,
typename std::atomic<T>::value_type desired,
std::memory_order order ) noexcept;
1,2) Atomically replaces the value pointed to by obj with the value of desired as if by obj->store(desired).
3,4) Atomically replaces the value pointed to by obj with the value of desired as if by obj->store(desired, order).
β οΈ bestie, listen: iforderis one ofstd::memory_order_consume,std::memory_order_acquireandstd::memory_order_acq_rel, the behavior is undefined. Like, undefined behavior. Do not play with that. π
π Parameters π
objβ pointer to the atomic object to modifydesiredβ the value to store in the atomic objectorderβ the memory synchronization ordering
π¦ Return value π¦
(none)
literally nothing β it is giving void, no return, no takebacks. π«Ά
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
P0558R1β applied toC++11.- Behavior as published: exact type match was required because
Tis only deduced. - Correct behavior:
Twas deduced from multiple arguments fromobj.
- Behavior as published: exact type match was required because
π See also π
storeβ atomically replaces the value of the atomic object with a non-atomic argument (public member function ofstd::atomic<T>)atomic_load(C++11)β atomically obtains the value stored in an atomic object (function template)atomic_load_explicit(C++11)β atomically obtains the value stored in an atomic object (function template)memory_order(C++11)β defines memory ordering constraints for the given atomic operation (enum)std::atomic_store(std::shared_ptr)β specializes atomic operations forstd::shared_ptr(function template; deprecated in C++20; removed in C++26)std::atomic_store_explicit(std::shared_ptr)β specializes atomic operations forstd::shared_ptr(function template; deprecated in C++20; removed in C++26)- C documentation for
atomic_store,atomic_store_explicit
mwah π that is the whole page, bestie. source/version: http://cppreference.com; date: 2024.06.10; manual: std::atomic...re_explicit(3). go be iconic with your atomics π«Άβ¨
π¦ 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