I have a code like:
std::vector<std::future<..>> futures;
for(...)
{
futures.emplace_back(std::async(std::launch::async, ...))
}
for (auto& future : futures)
{
try
{
result += future.get();
}
catch (std::exception const& e)
{
}
}
If an exception is thrown in second future I will receive it only when the first future will be done. Is there a way to interrupt all futures?