std::promise::operator=(3)

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

okay so welcome to std::promise::operator= from the C++ Standard Libary manual πŸ’… yes bestie, that's the vibe, let's get into it.

πŸ’… NAME

The original NAME line is literally std::promise::operator= - std::promise::operator=, and honestly? no notes. πŸ’…

✨ Synopsis ✨

promise& operator=( promise&& other ) noexcept;    (1) (since C++11)
promise& operator=( const promise& rhs ) = delete; (2) (since C++11)

Assigns the contents. that's the whole assignment agenda, no cap πŸŽ€

  1. Move assignment operator. First, abandons the shared state (as in ~promise()), then assigns the shared state of other as if by executing std::promise(std::move(other)).swap(*this). highkey iconic behavior πŸ”₯
  2. promise is not copy-assignable. periodt.
🚨 real talk: item 2 is not a suggestion β€” promise is not copy-assignable.

πŸŽ€ Parameters

  • other β€” another promise to acquire the state from 🫢

🫢 Return value

*this β€” that's it, that's the return value, literally the main character returning itself ✨


mwah πŸ’‹ β€” source/version/date: http://cppreference.com, 2024.06.10, std::promise::operator=(3). byeee bestie πŸ¦‹

πŸ“¦ where this page comes from