std::experi...k_ptr::store(3)
π NAME π
std::experimental::atomic_weak_ptr::store β the one and only std::experimental::atomic_weak_ptr::store (yes, the original lists it twice, and weβre keeping that iconic little echo π
).
okay so bestie, welcome to the <pink>std::experi...k_ptr::store(3)</pink> page from the <purple>C++ Standard Libary</purple> β this one is all about storing a weak_ptr into an atomic variable, with memory-order flavor β¨.
β¨ Synopsis β¨
void store( weak_ptr<T> desired, std::memory_order order =
std::memory_order_seq_cst ) noexcept;
It atomically replaces the current value with desired. The memory effects depend on the value of order. π«Ά
π¨ real talk:ordermust be one ofstd::memory_order_relaxed,std::memory_order_release, orstd::memory_order_seq_cst. If itβs anything else, the behavior is undefined β bestie, do not test fate on this one π.
π Parameters π
desiredβ theweak_ptrto store into the atomic variable.orderβ memory order constraints to enforce.
π¦ Return value π¦
(none) β ngl, nothing comes back. Itβs giving βdo the thing, return nothingβ energy π.
πΈ Remarks πΈ
All changes to the atomic_weak_ptr object itself, plus all associated use_count increments, are guaranteed to be performed atomically. The associated use_count decrements take place after the atomic operation, but they are not required to be part of it. Any associated destruction or deallocation operations also take place after the atomic operation and are not part of it. β¨
π See also π
- stores a value into an
operator=atomic_weak_ptrobject (public member function) std::atomic_is_lock_free(std::shared_ptr)std::atomic_load(std::shared_ptr)std::atomic_load_explicit(std::shared_ptr)std::atomic_store(std::shared_ptr)std::atomic_store_explicit(std::shared_ptr)- specializes atomic operations for
std::shared_ptr(function template) std::atomic_exchange(std::shared_ptr)std::atomic_exchange_explicit(std::shared_ptr)std::atomic_compare_exchange_weak(std::shared_ptr)std::atomic_compare_exchange_strong(std::shared_ptr)std::atomic_compare_exchange_weak_explicit(std::shared_ptr)std::atomic_compare_exchange_strong_explicit(std::shared_ptr)(deprecated in C++20)(removed in C++26)
okay bestie, thatβs the whole page β source/version/date vibes: <cyan>http://cppreference.com</cyan>, <mint>2024.06.10</mint>, for <pink>std::experi...k_ptr::store(3)</pink>. slay and stay atomic π
β¨π«Ά
π¦ 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