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

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

std::swap(s...tringstream)(3) πŸ’…

okay so bestie, welcome to the C++ Standard Libary manual β€” yes, that’s the manual name as printed, typo and all 😭 β€” and the page we’re on is std::swap(s...tringstream)(3). We’re talking about std::swap(std::basic_ostringstream), and it’s giving tiny overload, main character energy, no cap ✨

✨ NAME ✨

std::swap(std::basic_ostringstream) - std::swap(std::basic_ostringstream)

πŸ¦‹ Synopsis πŸ¦‹

Defined in header <sstream>, and look at this little template situation:

          Defined in header <sstream>
          template< class CharT, class Traits, class Alloc >

          void swap( std::basic_ostringstream<CharT,Traits,Alloc>& lhs,
       (since C++11)

                     std::basic_ostringstream<CharT,Traits,Alloc>& rhs );

This overloads the std::swap algorithm for std::basic_ostringstream. It exchanges the state of lhs with that of rhs. Effectively calls lhs.swap(rhs). That’s the whole flex, and honestly? iconic 🫢

πŸ’– Parameters πŸ’–

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

πŸŽ€ Return value πŸŽ€

(none)

literally no return value, bestie. it just does the swap and vibes πŸ’…

🌸 Exceptions 🌸

May throw implementation-defined exceptions.

so yeah, the implementation gets to decide some of the exception details here β€” that’s the whole β€œimplementation-defined” situation, and we respect it πŸ™ˆ

🫢 Example 🫢

This section is incomplete Reason: no example

not me hoping for an example and getting this instead 😭 the manual said β€œno example” and meant it.

πŸ”₯ See also πŸ”₯

  • swap β€” swaps two string streams (C++11) (public member function)

🌈 Category 🌈

  • Todo no example

cute little sign-off time: this page came from http://cppreference.com, with the version/date 2024.06.10, and the page name std::swap(s...tringstream)(3) β€” bye bestie, go swap responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from