std::swap(s...ospanstream)(3)

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

okay so bestie, welcome to the C++ Standard Libary manual πŸ’– we’re on the std::swap(s...ospanstream)(3) page, and today’s main character is std::swap(std::basic_ospanstream). yes, that β€œLibary” spelling is literally in the header 😭 anyway, let’s get into it.

🌸 NAME 🌸

std::swap(std::basic_ospanstream) β€” std::swap(std::basic_ospanstream)

the way this name and description are the exact same thing is giving copy-paste energy, but periodt, that’s the page πŸ’…

✨ Synopsis ✨

          Defined in header <spanstream>
          template< class CharT, class Traits >

          void swap( std::basic_ospanstream<CharT, Traits>& lhs,    (since
       C++23)

                     std::basic_ospanstream<CharT, Traits>& rhs );

so this overloads the std::swap algorithm for std::basic_ospanstream 🫢 it exchanges the state of lhs with that of rhs, and effectively calls lhs.swap(rhs). no cap, that’s the whole vibe.

πŸ¦‹ Parameters πŸ¦‹

  • lhs, rhs β€” streams whose state to swap

🌸 Return value 🌸

(none) β€” literally nothing comes back, bestie. it’s giving β€œI did the swap, you’re welcome, bye” πŸ’€

πŸ”₯ Exceptions πŸ”₯

May throw implementation-defined exceptions.

so the implementation gets to decide the exact exception situation 😭 don’t go assuming extra guarantees beyond that, fr fr.

πŸŽ€ Example πŸŽ€

This section is incomplete

Reason: no example

not me reading β€œno example” and feeling personally attacked πŸ™ˆ but okay, that’s what the page says.

πŸ‘‘ See also πŸ‘‘

  • swap β€” swaps two basic_ospanstream objects (C++23) (public member function)

πŸ’€ Category πŸ’€

* Todo no example


πŸ’Œ source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::swap(s...ospanstream)(3) β€” ok bye bestie, drink water, and swap responsibly! πŸ’–βœ¨

πŸ“¦ where this page comes from