terminate called after throwing an instance of 'std::future_error' what(): std::future_error: No associated state
A std::future or std::promise was used after being moved or without a shared state.
std::future_error No associated statePromise already satisfiedBroken promise 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
- Check
valid()beforeget() - Use
std::shared_futurefor several readers - Always set a value or exception on every promise
Detailed fix by platform
C++
if (f.valid()) auto v = f.get();
How to diagnose
- State — valid()?
- Count — get() called once?
- Promise — Set on every path?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- bad_cast terminate called after throwing an instance of 'std::bad_cast' what(): std::bad_cast
- bad_function_call terminate called after throwing 'std::bad_function_call' what(): bad_function_call
- bad_variant_access terminate called after throwing 'std::bad_variant_access' / 'std::bad_optional_access'
Most viewed in C/C++
- Bus error C/C++: Bus error (core dumped) — SIGBUS from misaligned access or a bad memory-mapped file
- AddressSanitizer: heap-buffer-overflow C/C++: ==ERROR: AddressSanitizer: heap-buffer-overflow on address — READ/WRITE of size N
- AddressSanitizer: heap-use-after-free C/C++: ==ERROR: AddressSanitizer: heap-use-after-free on address — memory used after delete/free
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 2 Dec 2026