std::basic_...::operator=(3)

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

πŸ¦‹ std::basic_...::operator=(3) πŸ¦‹

okay bestie, this page is from the C++ Standard Libary manual, and the manual name is folded in right here near the top like a lil sticker. We’re talking about std::basic_iostream::operator=, and yes, it’s giving stream-assignment main character energy. πŸ’…

✨ NAME ✨

std::basic_iostream::operator= β€” std::basic_iostream::operator=

🌸 Synopsis 🌸

Here’s the exact signature situation, no cap:

          basic_iostream& operator=( const basic_iostream& other ) = delete;
       (1)
          protected:
       (2) (since C++11)
          basic_iostream& operator=( basic_iostream&& other );

Assigns another stream object.

  1. Copy assignment is not allowed. 🚫
  2. Move assigns another stream object. Effectively calls swap(rhs). πŸ”

This move assignment operator is protected: it is called by the move assignment operators of the derived stream classes std::basic_stringstream and std::basic_fstream which know how to properly move-assign the associated stream buffers. Like, it’s protected for a reason, bestie β€” those derived classes are the ones who know the move-assign choreography for the stream buffers. 🫢

πŸŽ€ Parameters πŸŽ€

  • other β€” another stream to assign state of.

πŸ’– Return value πŸ’–

*this β€” yes bestie, it returns itself, iconic behavior.

🌈 See also 🌈

  • constructor β€” constructs the object (public member function).

Cute lil sign-off: this page’s source is http://cppreference.com, its version/date is 2024.06.10, and its footer tag is std::basic_...::operator=(3). bye bestie, go slay some streams πŸ’œπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from