Question 15
Back to Exercise
A function run with std::async throws. What happens?
- A The program terminates
- B The exception is stored in the future and rethrown by get() Correct
- C It is silently ignored
- D The thread restarts
Correct Answer: Option B
An exception escaping a plain std::thread function, by contrast, calls std::terminate.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!