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

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

πŸ’– NAME πŸ’–

std::basic_ispanstream::operator= β€” std::basic_ispanstream::operator= (yes bestie, the name is literally the name, and we respect the minimalism πŸ’…)

okay so this is std::basic_...m::operator=(3) from the C++ Standard Libary manual, and we're about to get into the move-assignment of it all ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

basic_ispanstream& operator=( basic_ispanstream&& other );

(1) (since C++23)

basic_ispanstream& operator=( const basic_ispanstream& ) = delete;

(2) (since C++23)

🌸 the actual tea 🌸

  1. Move assignment (1) β€” Move assigns other to *this, effectively move-assigning both the std::basic_istream base class subobject and the wrapped std::basic_spanbuf. it's giving "both of you are moving, no cap" 🫢
  2. Copy assignment (2) β€” Copy assignment operator is deleted. basic_ispanstream is not copy assignable. periodt, she does not do copies πŸ™ˆ

Note that move assignment operator of the base class swaps all stream state variables (except for rdbuf()) between *this and other. the way that rdbuf() is the exception is so specific, iykyk πŸ’€

It is implementation-defined whether the std::basic_spanbuf wrapped in other still holds an underlying buffer after the move assignment. so like, that part is left up to the implementation bestie, don't come for me 🌈


πŸ“ PARAMETERS πŸ“

  • other β€” another stream to move from

⭐ RETURN VALUE ⭐

*this β€” cute, iconic, returns itself πŸ’–

πŸ’€ EXCEPTIONS πŸ’€

May throw implementation-defined exceptions. so yeah, implementation-defined again, the mystery of it all 😭

πŸ™ˆ EXAMPLE πŸ™ˆ

This section is incomplete.

Reason: no example 🫠

πŸ‘‘ SEE ALSO πŸ‘‘

  • operator= assigns a basic_spanbuf object (C++23) (public member function of std::basic_spanbuf<CharT,Traits>)
  • operator= move-assigns from another basic_istream (C++11) (protected member function)

Category: * Todo no example


mwah πŸ’œ source/version/date sign-off: http://cppreference.com, 2024.06.10, page std::basic_...m::operator=(3) β€” slay and goodbye βœ¨πŸŽ€

πŸ“¦ where this page comes from