diff --git a/include/boost/fiber/future/detail/task_object.hpp b/include/boost/fiber/future/detail/task_object.hpp index 52c8c7a4..2629f19e 100644 --- a/include/boost/fiber/future/detail/task_object.hpp +++ b/include/boost/fiber/future/detail/task_object.hpp @@ -13,6 +13,7 @@ #include #include +#include #include #ifdef BOOST_HAS_ABI_HEADERS @@ -38,7 +39,7 @@ public: void run( Args && ... args) { try { - this->set_value( fn_( std::forward< Args >( args) ... ) ); + this->set_value( invoke( fn_, std::forward< Args >( args) ... ) ); } catch (...) { this->set_exception( std::current_exception() ); } @@ -74,7 +75,7 @@ public: void run( Args && ... args) { try { - fn_( std::forward< Args >( args) ... ); + invoke( fn_, std::forward< Args >( args) ... ); this->set_value(); } catch (...) { this->set_exception( std::current_exception() );