std::basic_ios::swap(3)
π std::basic_ios::swap(3) π
okay so bestie, this is the std::basic_ios::swap(3) page from the C++ Standard Libary manual, and we're about to get into a very specific little state-swap situation π«Ά
π NAME π
std::basic_ios::swap - std::basic_ios::swap
like, that's the name, that's the function, no notes β¨
πΈ Synopsis πΈ
It's protected, and it's been around (since C++11):
protected: (since C++11)
void swap( basic_ios& other ) noexcept;
So what does it actually do? It exchanges the states of *this and other, except for the associated rdbuf objects. The way that works: rdbuf() and other.rdbuf() return the same values as before the call. periodt.
This swap function is protected: it is called by the swap member functions of the derived stream classes such as std::basic_ofstream or std::basic_istringstream, which know how to correctly swap the associated streambuffers. so it's giving "backstage pass only" π
π Parameters π
otherβ thebasic_iosobject to exchange the state with. that's the bestie you're swapping vibes with π
π Return value π
(none) β literally no return value, it just does the swap and leaves π
π¦ See also π¦
moveβ moves from anotherstd::basic_iosexcept forrdbuf(C++11) (protected member function). iconic little relocation moment π
okay bye bestie π β source: http://cppreference.com, version/date: 2024.06.10.
π¦ 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