std::basic_spanbuf::swap(3)

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

🌸 std::basic_spanbuf::swap 🌸

okay bestie, welcome to the C++ Standard Libary page for std::basic_spanbuf::swap β€” yes, the header really spells it like that, and we are keeping it πŸ’…. This is the swap function for std::basic_spanbuf, and it is lowkey iconic.

πŸ’– NAME πŸ’–

std::basic_spanbuf::swap β€” std::basic_spanbuf::swap (the name said it twice, and honestly? slay ✨).

πŸ¦‹ Synopsis πŸ¦‹

void swap( basic_spanbuf& rhs );

(since C++23) β€” a fresh C++23 baby πŸ‘‘

Swaps the state of *this and rhs.

Calls std::basic_streambuf<Char, Traits>::swap(rhs), swaps the open mode of *this and rhs, and then makes them use the underlying buffer of each other. fr fr, that’s the whole move 🫢.

πŸŽ€ Parameters πŸŽ€

  • rhs β€” another basic_stringbuf (yes, that’s the exact text, no cap πŸ™ˆ).

⭐ Return value ⭐

  • (none) β€” nothing comes back, it just does the swap and vibes πŸ’«.

πŸ”₯ Exceptions πŸ”₯

May throw implementation-defined exceptions. So like, it might throw, but the implementation gets to decide the details β€” periodt πŸ’€.

πŸ‘‘ Notes πŸ‘‘

This function is called automatically when swapping stream objects, it is rarely necessary to call it directly. So bestie, you usually don’t have to invite it to the group chat yourself πŸ’….

🌈 Example 🌈

This section is incomplete Reason: no example

the docs are literally giving β€œtrust me bro” energy 😭 no example yet.

πŸ¦‹ See also πŸ¦‹

  • operator= β€” assigns a basic_spanbuf object (C++23) (public member function)
  • swap β€” swaps two basic_ispanstream objects (C++23) (public member function of std::basic_ispanstream<CharT,Traits>)
  • swap β€” swaps two basic_ospanstream objects (C++23) (public member function of std::basic_ospanstream<CharT,Traits>)
  • swap β€” swaps two basic_spanstream objects (C++23) (public member function of std::basic_spanstream<CharT,Traits>)

πŸ“ Category πŸ“

  • * Todo no example

sign-off: source http://cppreference.com, version/date 2024.06.10, page std::basic_spanbuf::swap(3) β€” mwah πŸ’‹ go off, bestie 🫢

πŸ“¦ where this page comes from