# std::promise<R>::operator=

> C++ Atlas: `cppatlas.com/w/cpp/thread/promise/operator=` | Source: https://en.cppreference.com/w/cpp/thread/promise/operator= | Domain: Concurrency support | Standards: C++11

## Official Specification Summary (cppreference)

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

Assigns the contents.

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)`.

2) `promise` is not copy-assignable.

### Parameters

- `other` - another `promise` to acquire the state from

### Return value

`*this`

---
Attribution: content from https://en.cppreference.com/w/cpp/thread/promise/operator= (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.