# terminate called after throwing an instance of 'std::future_error' what(): std::future_error: No associated state

**Code:** `No associated state` · **Category:** C/C++ · **Seen on:** C/C++, GCC

A `std::future` or `std::promise` was used after being moved or without a shared state.

## Meaning

`get()` can be called only once per future and a default-constructed future has no state. Similar messages: `Promise already satisfied`, `Broken promise`.

## Common causes

- Calling `get()` twice
- Future moved-from
- Default-constructed future
- Promise destroyed before setting a value

## Quick fix

1. Check `valid()` before `get()`
2. Use `std::shared_future` for several readers
3. Always set a value or exception on every promise

## Detailed fix by platform

### C++

1. `if (f.valid()) auto v = f.get();`

## How to diagnose

1. **State** — valid()?
2. **Count** — get() called once?
3. **Promise** — Set on every path?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cpp/std-future-error-no-state)
