std::basic_spanbuf::swap(3)
πΈ std::basic_spanbuf::swap πΈ
okay bestie, welcome to the C++ Standard Libary page for std::basic_spanbuf::swap β yes, the header really spells it like that, and we are keeping it π
. This is the swap function for std::basic_spanbuf, and it is lowkey iconic.
π NAME π
std::basic_spanbuf::swap β std::basic_spanbuf::swap (the name said it twice, and honestly? slay β¨).
π¦ Synopsis π¦
void swap( basic_spanbuf& rhs );
(since C++23) β a fresh C++23 baby π
Swaps the state of *this and rhs.
Calls std::basic_streambuf<Char, Traits>::swap(rhs), swaps the open mode of *this and rhs, and then makes them use the underlying buffer of each other. fr fr, thatβs the whole move π«Ά.
π Parameters π
rhsβ anotherbasic_stringbuf(yes, thatβs the exact text, no cap π).
β Return value β
(none)β nothing comes back, it just does the swap and vibes π«.
π₯ Exceptions π₯
May throw implementation-defined exceptions. So like, it might throw, but the implementation gets to decide the details β periodt π.
π Notes π
This function is called automatically when swapping stream objects, it is rarely necessary to call it directly. So bestie, you usually donβt have to invite it to the group chat yourself π .
π Example π
This section is incompleteReason: no example
the docs are literally giving βtrust me broβ energy π no example yet.
π¦ See also π¦
operator=β assigns abasic_spanbufobject (C++23) (public member function)swapβ swaps twobasic_ispanstreamobjects (C++23) (public member function ofstd::basic_ispanstream<CharT,Traits>)swapβ swaps twobasic_ospanstreamobjects (C++23) (public member function ofstd::basic_ospanstream<CharT,Traits>)swapβ swaps twobasic_spanstreamobjects (C++23) (public member function ofstd::basic_spanstream<CharT,Traits>)
π Category π
* Todo no example
sign-off: source http://cppreference.com, version/date 2024.06.10, page std::basic_spanbuf::swap(3) β mwah π go off, bestie π«Ά
π¦ 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