On 9/7/2015 5:42 PM, Nat Goodspeed wrote:
On Mon, Sep 7, 2015 at 4:28 PM, Agustín K-ballo Bergé
wrote: `fiber::async` signature is still wrong. Note this was a C++11 defect:
So to be clear, I think you are requesting this instead?
template< typename Fn, typename ... Args > future< typename std::result_of< typename std::decay<Fn>::type(typename std::decay<Args>::type... ) >::type > async( Fn && fn, Args && ... args) { ... }
(making the corresponding future<> type change in both overloads of course)
That's the signature fix, yes. It appears the implementation already decay-copies the arguments correctly. But since you had me double check: - The result paragraph reads "future< typename result_of< Fn >::type > representing the shared state associated with the asynchronous execution of fn.", that's wrong too. - The implementation of `invoke_helper` looks weird: https://github.com/olk/boost-fiber/blob/master/include/boost/fiber/detail/in.... `std::get< I >( std::forward< Tpl >( tpl) )` should suffice. - The implementation of `async` moves a local future while returning it. This is an anti-pattern, since it prevents elision. Regards, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com