std::experi...e::operator=(3)

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

This is the std::experi...e::operator=(3) page, folded in from the C++ Standard Libary manual (yes, that spelling is straight from the header, bestie β€” not me πŸ’€). It’s giving two overloads, one job: assign a shared_future.

πŸ’… NAME

std::experimental::shared_future::operator= - std::experimental::shared_future::operator=

Yeah. The NAME section really does say it twice. We love a self-referential moment. ✨

✨ Synopsis

          std::experimental::shared_future<T>& operator=( const
       (1)
          std::experimental::shared_future<T>& other );
          std::experimental::shared_future<T>& operator=(
       (2)
          std::experimental::shared_future<T>&& other ) noexcept;

Okay so the synopsis block above is exactly as the page gives it, line breaks and all β€” I’m not touching that. Overload (1) takes const std::experimental::shared_future<T>& other. Overload (2) takes std::experimental::shared_future<T>&& other and is marked noexcept.

Both overloads assign the contents of another std::experimental::shared_future object.

  1. Releases any shared state and assigns the contents of other to *this. After the assignment, this->valid() == other.valid().
  2. Releases any shared state and move-assigns the contents of other to *this. After the assignment, other.valid() == false and this->valid() will yield the same value as other.valid() before the assignment.

🌸 Parameters

  • other β€” a std::experimental::shared_future object to assign from.

πŸŽ€ Return value

The return value is literally just *this. That’s it. That’s the whole vibe. 🫢


mwah πŸ’‹ that’s the page β€” from http://cppreference.com, dated 2024.06.10, for std::experi...e::operator=(3). Bye bestie πŸ¦‹

πŸ“¦ where this page comes from