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

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

okay bestie, welcome to the std::basic_fstream::operator=(3) page, straight from the C++ Standard Libary manual ✨ grab a strawberry πŸ“ and let's move-assign some streams.

🌸 NAME 🌸

std::basic_fstream::operator= β€” aka std::basic_fstream::operator= πŸ’… yes, the same name twice, that's literally the NAME section's whole vibe.

✨ SYNOPSIS ✨

basic_fstream& operator=( basic_fstream&& other );  (since C++11)

Okay so this one is a C++11 baddie: it move assigns the file stream other to *this, effectively move-assigning both the std::basic_iostream base class and the associated std::basic_filebuf. Slay. πŸ”₯

After that, other is left with no associated file. Also note: the base class move assignment swaps all stream state variables (except for rdbuf) between *this and other. That's the tea β˜•.

πŸŽ€ PARAMETERS πŸŽ€

  • other β€” file stream to move 🫢

πŸ’– RETURN VALUE πŸ’–

  • *this β€” that's the return, periodt. πŸ‘‘

πŸ¦‹ EXAMPLE πŸ¦‹

This section is incomplete.

Reason: no example.

Not me showing up with an empty example section πŸ™ˆ but that's literally what the page says.

🌈 SEE ALSO 🌈

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

πŸ’… CATEGORY πŸ’…

  • * Todo no example

source/version sign-off: http://cppreference.com, dated 2024.06.10, page std::basic_...m::operator=(3) β€” mwah, bestie πŸ’‹

πŸ“¦ where this page comes from