# std::promise<R>::~promise

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

Abandons the shared state:

## Official Specification Summary (cppreference)

```cpp
~promise(); // (since C++11)
```

Abandons the shared state:

- if the shared state is ready, releases it.
- if the shared state is not ready, stores an exception object of type `std::future_error` with an error condition `std::future_errc::broken_promise`, makes the shared state ready and releases it.

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