std::shared...e::operator=(3)
π std::shared...e::operator=(3) π
okay bestie, welcome to the C++ Standard Libary manual β yes, thatβs the manual name, typo and all, and we are obsessed with the chaos. This page is all about std::shared_future::operator=, the assignment operator, and itβs giving very specific overload energy. π«Ά
π NAME π
std::shared_future::operator= β literally std::shared_future::operator=. No cap, thatβs the name.
β¨ Synopsis β¨
The source synopsis has line wrapping doing the absolute most, so here are the exact signatures and annotations, bestie:
shared_future& operator=( const shared_future& other );
(since C++11)
(until
C++17)
shared_future& operator=( const shared_future& other ) (1)
(since C++17)
noexcept;
shared_future& operator=( shared_future&& other ) noexcept;
(2) (since C++11)
(Yes, noexcept; is sitting on its own line in the source. I am not editing the sacred text. π)
Okay so what does it actually do? It assigns the contents of another shared_future. The two overloads are giving different energy:
- Releases any shared state and assigns the contents of
otherto*this. After the assignment,this->valid() == other.valid(). Slay. - Releases any shared state and move-assigns the contents of
otherto*this. After the assignment,other.valid() == falseandthis->valid()will yield the same value asother.valid()before the assignment. The move is moving, periodt.
π Parameters π
otherβ astd::shared_futurethat will transfer state to*this. Thatβs the whole parameter list, bestie.
π Return value π
*this. Thatβs it. It returns *this, and honestly thatβs main character energy. β¨
mwah π this page is from http://cppreference.com, dated 2024.06.10, and itβs std::shared...e::operator=(3). bye bestie, go assign responsibly π«Άπ
π¦ 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