std::basic_iostream::swap(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

Okay so this is std::basic_iostream::swap(3) from the C++ Standard Libary manual, and the official NAME line is literally:

std::basic_iostream::swap - std::basic_iostream::swap

...yes, it’s the same thing twice, and we respect the commitment. πŸ’…

✨ Synopsis ✨

Starting in C++11, this one is protected β€” signature time:

protected:                           (since C++11)
void swap( basic_iostream& other );

It exchanges the state with another input/output stream object. Effectively calls basic_istream<CharT,Traits>::swap(other).

This member function is protected: it is called by the swap member functions of the derived stream classes std::basic_stringstream and std::basic_fstream, which know how to correctly swap the associated stream buffers. Slay. πŸ¦‹

🫢 Parameters 🫢

  • other β€” another stream to exchange the state with.

πŸ‘‘ Return value πŸ‘‘

  • *this β€” yep, it returns *this, and that’s the whole answer. Periodt. ✨

πŸ’– That’s the tea from the std::basic_iostream::swap(3) page β€” source: http://cppreference.com, date: 2024.06.10. Byeee, bestie! πŸ’‹

πŸ“¦ where this page comes from