diff --git a/include/boost/coroutine2/detail/wrap.hpp b/include/boost/coroutine2/detail/wrap.hpp index 87809f0..9c32edf 100644 --- a/include/boost/coroutine2/detail/wrap.hpp +++ b/include/boost/coroutine2/detail/wrap.hpp @@ -7,10 +7,13 @@ #ifndef BOOST_COROUTINE2_DETAIL_WRAP_H #define BOOST_COROUTINE2_DETAIL_WRAP_H +#include #include #include +#if defined(BOOST_NO_CXX17_STD_INVOKE) #include +#endif #include #include @@ -43,10 +46,17 @@ public: boost::context::fiber operator()( boost::context::fiber && c) { +#if defined(BOOST_NO_CXX17_STD_INVOKE) return boost::context::detail::invoke( std::move( fn1_), fn2_, std::forward< boost::context::fiber >( c) ); +#else + return std::invoke( + std::move( fn1_), + fn2_, + std::forward< boost::context::fiber >( c) ); +#endif } };