mirror of
https://github.com/boostorg/coroutine2.git
synced 2025-05-09 15:14:01 +00:00
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.
This commit is contained in:
parent
bf12f185c8
commit
d7e1c1c4ab
@ -7,10 +7,13 @@
|
||||
#ifndef BOOST_COROUTINE2_DETAIL_WRAP_H
|
||||
#define BOOST_COROUTINE2_DETAIL_WRAP_H
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_CXX17_STD_INVOKE)
|
||||
#include <boost/context/detail/invoke.hpp>
|
||||
#endif
|
||||
#include <boost/context/fiber.hpp>
|
||||
|
||||
#include <boost/coroutine2/detail/config.hpp>
|
||||
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user