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

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

πŸ’… std::swap(s...c_stringbuf)(3) β€” straight outta the C++ Standard Libary, bestie 🫢

Okay so welcome to this little corner of the C++ Standard Libary β€” yes, that's the manual-name vibe β€” where we're talking about swapping std::basic_stringbuf objects. It's giving very specific, very niche, very iconic. ✨


🌸 NAME 🌸

  • std::swap(std::basic_stringbuf) - std::swap(std::basic_stringbuf) πŸŽ€

✨ Synopsis ✨

First things first: it's Defined in header <sstream> πŸ“¦ β€” literally, that's the header. Here's the synopsis in all its exact-code glory:

          Defined in header <sstream>
          template< class CharT, class Traits, class Alloc >
                                                                       (since
       C++11)
          void swap( std::basic_stringbuf<CharT,Traits,Alloc>& lhs,    (until
       C++20)

                     std::basic_stringbuf<CharT,Traits,Alloc>& rhs );
          template< class CharT, class Traits, class Alloc >

          void swap( std::basic_stringbuf<CharT,Traits,Alloc>& lhs,    (since
       C++20)
                     std::basic_stringbuf<CharT,Traits,Alloc>& rhs )

              noexcept(noexcept(lhs.swap(rhs)));

So what's the tea? This overloads the std::swap algorithm for std::basic_stringbuf. It exchanges the state of lhs with that of rhs, and effectively calls lhs.swap(rhs). No cap, that's the whole move. πŸ’«


πŸ¦‹ Parameters πŸ¦‹

  • lhs, rhs β€” std::basic_stringbuf objects whose states to swap πŸ”„

πŸŽ€ Return value πŸŽ€

  • (none) β€” literally nothing, bestie πŸ’€

🌈 Example 🌈

This section is incomplete Reason: no example 😭

πŸ‘‘ See also πŸ‘‘

  • swap β€” swaps two basic_stringbuf objects; (C++11) (public member function) ✨
  • swap β€” swaps the values of two objects; (function template) 🫢

🧾 Category

  • * Todo no example πŸ“Œ

mwah πŸ’‹ β€” source/version/date vibes for the sign-off: this page comes from http://cppreference.com, dated 2024.06.10, with footer title std::swap(s...c_stringbuf)(3). That's the whole page, bestie β€” go forth and swap those stringbufs πŸŽ€πŸ’–

πŸ“¦ where this page comes from