...
In this compliant solution, the thread_start()
handles all exceptions and does not rethrow, allowing the thread to terminate normally:
Code Block | ||||
---|---|---|---|---|
| ||||
#include <thread> void throwing_func() noexcept(false); void thread_start(void) { try { throwing_func(); } catch (...) { // Handle error } } void f() { std::thread t(thread_start); t.join(); } |
...