std::experi...r::operator=(3)
π NAME π
std::experimental::atomic_weak_ptr::operator= β okay so this is literally the assignment operator for std::experimental::atomic_weak_ptr, and yes bestie, it's giving very niche, very C++ Standard Libary (that's the manual name, not my typo, I promise π«Ά), very "you either know or you don't" energy. iykyk.
β¨ SYNOPSIS β¨
void operator=( weak_ptr<T> desired ) noexcept; (1)
void operator=( const atomic_weak_ptr& ) = delete; (2)
okay so there's exactly two of these and they are NOT the same vibe:
- the real one β atomically assigns a value
desiredto the atomic variable. Equivalent tostore(desired). slay. β¨ - the deleted one β atomic variables are not
CopyAssignable. so this overload is= deleteand it is very much not invited to the party π
π PARAMETERS π
desiredβ the value to assign. that's it, that's the whole parameter. she's simple, she's iconic.
πΈ NOTES πΈ
okay here's the tea π β unlike most assignment operators (which hand you back a reference so you can chain them like a = b = c), the assignment operators for atomic_weak_ptr return void. so no chaining, no sneaky return value, just vibes and completion. periodt.
π¦ Remarks π¦
- All changes to the
atomic_weak_ptrobject itself, and all associateduse_countincrements, are guaranteed to be performed atomically. no cap, that's the whole point π₯ - Associated
use_countdecrements take place after the atomic operation, but they are not required to be part of it. so they're like, adjacent to the main character moment, not in it. - Any associated destruction or deallocation operations take place after the atomic operation and are not part of it either. they show up fashionably late π
β SEE ALSO β
- constructor β constructs an
atomic_weak_ptrobject (public member function) storeβ atomically replaces the value of the atomic object with a non-atomic argument (public member function)
aaand the whole std::shared_ptr atomic operations crew, which specializes atomic operations for std::shared_ptr (function template) β here's the full roll call, no one gets left out bestie π:
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)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)
β οΈ heads up: some of that last group is (deprecated in C++20) and some is (removed in C++26), so check before you build your whole personality around them π
okay that's the whole page, we ate and left no crumbs π. this gem came from http://cppreference.com, dated 2024.06.10, and it's page std::experi...r::operator=(3) β see you in the next manpage, mwah ππ§ββοΈ
π¦ 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