std::basic_ios::move(3)

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

πŸ’… std::basic_ios::move(3)

okay bestie, this page is from the C++ Standard Libary manual, and it's giving protected-member-function realness for std::basic_ios::move. no cap, it's literally the move member function, and the vibe is very "internal plumbing but make it iconic." πŸŽ€


🌸 NAME 🌸

  • std::basic_ios::move β€” literally std::basic_ios::move, bestie, that's the whole name.

✨ Synopsis ✨

okay so there are two protected overloads, both since C++11, and they look exactly like this:

protected:                       (since C++11)
void move( basic_ios& other );
protected:                       (since C++11)
void move( basic_ios&& other );

What they do: replace the current state with that of other, except for the associated rdbuf. that exception is the whole vibe check β€” the rdbuf is not part of the state being swapped in with everything else. πŸ’…

After the call, other is in a valid, but unspecified state. And after the call to this function, these three things are true, fr fr:

  • rdbuf() returns a null pointer
  • other.rdbuf() returns the same value as before the call
  • other.tie() returns a null pointer

This member function is protected: it is called by the protected move constructors of the derived stream classes std::basic_ostream and std::basic_istream, which, in turn, are called by the public move constructors of the further derived stream classes such as std::basic_ofstream, which know how to correctly move the associated streambuffer. so yeah, it's backstage main-character energy, not something you just call directly from the group chat. 🫢


πŸ¦‹ Parameters πŸ¦‹

  • other β€” the basic_ios object to transfer the state from.

🌈 Return value 🌈

  • (none) β€” no return value, bestie. it's a void situation. πŸ’€

πŸ‘‘ See also πŸ‘‘

  • swap β€” swaps with another std::basic_ios except rdbuf (C++11) (protected member function).

xoxo, bestie πŸ’– β€” source http://cppreference.com, version/date 2024.06.10, page std::basic_ios::move(3).

πŸ“¦ where this page comes from