From d7e1c1c4abcf8c1e90097279e485edea0b253a80 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Wed, 3 Nov 2021 17:43:36 +0100 Subject: [PATCH] use std::invoke() vor C++17 onwards But std::invoke() is defined since C++17. For pre C++17 use boost::context::detail::invoke() instead. --- include/boost/coroutine2/detail/wrap.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 @@ class wrapper { 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 } };