The async call below is blocking because the destructor of the returned future is blocking:
async
void foo() {} void foo_async() { std::async(std
If you really want to fire-and-forget the call to foo(), I would say your workaround is OK.
foo()
Otherwise, just do auto f = std::async(std::launch::async, foo);, and possibly return the future from foo_async().
auto f = std::async(std::launch::async, foo);
foo_async()