std::basic_...m::operator=(3)
π std::basic_ospanstream::operator= (3) β straight out of the C++ Standard Libary, bestie
Okay so this one's from the C++ Standard Libary manpage, section 3, and it's literally all about std::basic_ospanstream::operator= β yes that's the whole name, no I'm not shortening it, it's iconic like that. π
β¨ NAME β¨
std::basic_ospanstream::operator= β literally what it says on the tin, the assignment operators for std::basic_ospanstream. That's it, that's the name. π
πΈ SYNOPSIS πΈ
basic_ospanstream& operator=( basic_ospanstream&& other );
(1) (since C++23)
basic_ospanstream& operator=( const basic_ospanstream& ) = delete;
(2) (since C++23)
ngl bestie the = delete on overload 2 is doing so much heavy lifting, we love a firm boundary. π§
π¦ DESCRIPTION π¦
Ok so let's break down the two overloads, no cap:
1) Move assigns other to *this β which effectively move-assigns both the std::basic_ostream base class subobject and the wrapped std::basic_spanbuf. Two for the price of one, periodt. β¨
2) The copy assignment operator is deleted. basic_ospanstream is not copy assignable. She said "no copies, only vibes." π
Heads up though: note that the move assignment operator of the base class swaps all stream state variables (except forrdbuf()) between*thisandother. Not just the cute ones β all of them. π
And this one's important, so pay attention: it is implementation-defined whether the std::basic_spanbuf wrapped in other still holds an underlying buffer after the move assignment. So likeβ¦ don't assume. It's giving "mystery box" energy and honestly that's the standard's business, not ours. π
π§ PARAMETERS π§
otherβ another stream to move from π«Ά
β RETURN VALUE β
*this β she returns herself, main character energy fr fr. π
π₯ EXCEPTIONS π₯
May throw implementation-defined exceptions. So like, it might throw, but which ones? Implementation-defined, bestie. Nobody knows, it's a surprise. π
π EXAMPLE π
This section is incomplete.
Reason: no example. π Not me showing up to an example section with no example. The audacity. (It's in the Todo category, so likeβ¦ known issue, we move.)
π SEE ALSO π
operator=β assigns abasic_spanbufobject (C++23) (public member function ofstd::basic_spanbuf<CharT,Traits>)operator=β move-assigns from anotherbasic_ostream(C++11) (protected member function)
π CATEGORY π
- Todo β no example π (yep, still not over it)
That's the whole page, bestie β no details left behind, we ate and left absolutely no crumbs. π½οΈβ¨
Oh and one last thing β this iconic little document comes from http://cppreference.com, dated 2024.06.10, filed under std::basic_...m::operator=(3). Go forth and move-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