std::basic_...::operator=(3)
π NAME
std::basic_spanstream::operator= β bestie, it's the assignment operator for std::basic_spanstream, and it's giving "move only, no copies, we don't do that here" energy π
This one lives in the C++ Standard Library man pages (yes, the actual official one, not a random blog post from 2009, iykyk) β¨
πΈ SYNOPSIS
basic_spanstream& operator=( basic_spanstream&& other ); (1)
(since C++23)
basic_spanstream& operator=( const basic_spanstream& ) = delete; (2)
(since C++23)
So there's literally two of them and only one of them actually works π«Ά
- This one move assigns other into
*thisβ and the way it does that is by effectively move-assigning both thestd::basic_iostreambase class subobject and the wrappedstd::basic_spanbufπ₯ - This one is the copy assignment operator and it's deleted.
basic_spanstreamis not copy assignable, periodt. No cap, no copies, no exceptions π
Heads up bestie π note that the move assignment operator of the base class swaps all stream state variables (except forrdbuf()) between*thisandother. That's the whole vibe.
Okay and also β it is implementation-defined whether thestd::basic_spanbufwrapped inotherstill holds an underlying buffer after the move assignment π So like... don't assume, okay?
β¨ PARAMETERS
otherβ another stream to move from π¦ (that's it, that's the whole parameter list, she's simple like that)
π RETURN VALUE
*this β she gives herself back, main character energy honestly π
π EXCEPTIONS
May throw implementation-defined exceptions. So like, it might, it's not a promise either way, check your implementation π
π EXAMPLE
This section is incomplete.
Reason: no example π (tragic, I know, the one thing we all wanted)
π§ SEE ALSO
operator=β assigns abasic_spanbufobject, (C++23), public member function ofstd::basic_spanbuf<CharT,Traits>πoperator=β move-assigns anotherbasic_iostream, (C++11), protected member function β
π CATEGORY
- Todo: no example πΈ
Okay that's the whole page bestie, go forth and move-assign responsibly π β¨
Source and version and date, for the record: http://cppreference.com, 2024.06.10, and the page is std::basic_...::operator=(3) β mwah, love u, bye π«Άππ¦
π¦ 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