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

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

πŸ’– NAME πŸ’–

Hey bestie! This is the std::basic_...m::operator=(3) page, living in the C++ Standard Libary manual β€” and yes, that β€œLibary” spelling is staying exactly as-is, we don’t touch the lore πŸ’…βœ¨.

The NAME section is literally serving the same name twice, with a lil dash:

std::basic_ostringstream::operator= -
std::basic_ostringstream::operator=

✨ Synopsis ✨

This is the move-assignment operator signature, no cap:

basic_ostringstream& operator=( basic_ostringstream&& other );

(since C++11)

So basically, it move-assigns the string stream other into *this, and that means it effectively move-assigns both the std::basic_ostream base class and the associated std::basic_stringbuf. The way that works is the moment.

Big note, bestie: the base class move assignment swaps all stream state variables between *this and other β€” every one of them except for rdbuf. That part is important, okay? 😌

πŸ¦‹ Parameters πŸ¦‹

  • other β€” the string stream to move from

πŸŽ€ Return value πŸŽ€

*this β€” that’s it, that’s the return. Periodt. πŸ’–

🌸 Example 🌸

This section is incomplete Reason: no example

(Yeah, the example is giving unfinished homework, but we’re reporting it exactly as the page does. πŸ™ˆ)

πŸ‘‘ See also πŸ‘‘

  • swap β€” swaps two string streams, (C++11), public member function
  • operator= β€” assigns a basic_stringbuf object, (C++11), public member function of std::basic_stringbuf<CharT,Traits,Allocator>
  • operator= β€” move-assigns from another basic_ostream, (C++11), protected member function

🌈 Category 🌈

  • * Todo no example

Okay that’s the whole vibe! Footer sign-off time, bestie: this came from http://cppreference.com, version/date 2024.06.10, and the footer title is std::basic_...m::operator=(3). Stay iconic, and may your streams always move correctly πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from