3 ms·
In C++ the default behaviour is for the runtime to call std::terminate, not segfault. It's easy to catch exceptions by wrapping the callable in a packaged_task
by blub 8y ago
In C++ the default behaviour is for the runtime to call std::terminate, not segfault. It's easy to catch exceptions by wrapping the callable in a packaged_task and then the exception is available in the future.
The key point is that the exception is rethrown when accessing the result through the future.
Swallowing exceptions is a really poor idea. Does Java really do that?