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

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

πŸ’… std::basic_...::operator=(3) πŸ’…

okay so bestie, this is the std::basic_ofstream::operator= page from the C++ Standard Libary manual β€” that’s literally how it’s spelled up top, iykyk πŸ’€. We’re talking about the move-assignment operator for std::basic_ofstream, and it’s lowkey iconic because it’s all about moving file streams around. πŸ¦‹

πŸ’– NAME πŸ’–

std::basic_ofstream::operator= β€” std::basic_ofstream::operator=

✨ Synopsis ✨

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

Move assigns the file stream other to *this, effectively move-assigning both the std::basic_ostream base class and the associated std::basic_filebuf. 🫢

other is left with no associated file. Note that the base class move assignment swaps all stream state variables (except for rdbuf) between *this and other. πŸ‘‘

πŸŽ€ Parameters πŸŽ€

  • other β€” file stream to move. πŸ“

πŸ¦‹ Return value πŸ¦‹

*this. That’s it, that’s the return value, bestie. πŸ’…

🌸 Example 🌸

This section is incomplete Reason: no example

πŸ”₯ 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 from another basic_ostream. (C++11) (protected member function)

⭐ Category ⭐

  • Todo no example

Source: http://cppreference.com Β· version/date: 2024.06.10 β€” bye bestie, go move-assign something cute πŸ’œβœ¨

πŸ“¦ where this page comes from