std::basic_...tream::swap(3)
β¨ std::basic_istringstream::swap β¨
okay so this is the man page for std::basic_istringstream::swap β yes, both names are literally the same thing, the C++ Standard Library is like that sometimes π
πΈ SYNOPSIS πΈ
void swap( basic_istringstream& other ); (since C++11)
Bestie. This member function has been around since C++11, and what it does is literally exchange the state of the stream with the state of other. Like a friendship bracelet swap but for stream state π«Ά
The way it pulls this off? By calling basic_istream<CharT, Traits>::swap(other) and rdbuf()->swap(*other.rdbuf()). Two swaps, one glow-up β¨
π PARAMETERS π
otherβ the stream you wanna exchange state with. your swap buddy, your other half, the one π¦
π RETURN VALUE π
(none) β she gives you nothing back, and honestly? iconic. the swap is the gift π
π₯ EXCEPTIONS π₯
May throw implementation-defined exceptions. no cap, that's a "check your implementation, bestie" situation π
π EXAMPLE π
This section is incomplete Reason: no example π
not me crying over a missing example. the todo list said what it said.
β SEE ALSO β
operator=β moves the string stream (C++11) (public member function)swapβ swaps twobasic_stringbufobjects (C++11) (public member function ofstd::basic_stringbuf<CharT,Traits,Allocator>)
π¦ CATEGORY π¦
- Todo no example π
that's the whole thing, bestie β go swap some streams, you got this π
source: cppreference.com Β· version 2024.06.10 β mwah, catch you on the next man page π§ββοΈπ
π¦ 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