Date
2009-02-09.00:00:00
Message id
1567

Content

Both overloads of async return future<typename F::result_type> which requires that F has a nested type. This prevents async being used with function pointers and makes the example in [futures.async] invalid. I believe this is unintentional.

The proposed resolution also addresses editorial issues with the launch_policy function parameter.

For the first overload it is not sufficient to return future<typename result_of<F(ArgTypes...)>::type>. Calling async(launch::xxx, foo, bar) performs argument deduction on both async overloads, which for the first overload attempts to instantiate result_of<launch(F, ArgTypes...)>, which is invalid. SFINAE must be used to prevent that.