diff options
Diffstat (limited to 'boost/coroutine2/detail/wrap.hpp')
-rw-r--r-- | boost/coroutine2/detail/wrap.hpp | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/boost/coroutine2/detail/wrap.hpp b/boost/coroutine2/detail/wrap.hpp index 25abce3b61..cd56338484 100644 --- a/boost/coroutine2/detail/wrap.hpp +++ b/boost/coroutine2/detail/wrap.hpp @@ -11,14 +11,9 @@ #include <boost/config.hpp> #include <boost/context/detail/invoke.hpp> -#if (BOOST_EXECUTION_CONTEXT==1) -# include <boost/context/execution_context.hpp> -#else -# include <boost/context/continuation.hpp> -#endif +#include <boost/context/continuation.hpp> -#include <boost/fiber/detail/config.hpp> -#include <boost/fiber/detail/data.hpp> +#include <boost/coroutine2/detail/config.hpp> #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -28,45 +23,6 @@ namespace boost { namespace coroutines2 { namespace detail { -#if (BOOST_EXECUTION_CONTEXT==1) -template< typename Fn1, typename Fn2 > -class wrapper { -private: - typename std::decay< Fn1 >::type fn1_; - typename std::decay< Fn2 >::type fn2_; - boost::context::execution_context ctx_; - -public: - wrapper( Fn1 && fn1, Fn2 && fn2, - boost::context::execution_context const& ctx) : - fn1_( std::move( fn1) ), - fn2_( std::move( fn2) ), - ctx_{ ctx } { - } - - wrapper( wrapper const&) = delete; - wrapper & operator=( wrapper const&) = delete; - - wrapper( wrapper && other) = default; - wrapper & operator=( wrapper && other) = default; - - void operator()( void * vp) { - boost::context::detail::invoke( - std::move( fn1_), - fn2_, ctx_, vp); - } -}; - -template< typename Fn1, typename Fn2 > -wrapper< Fn1, Fn2 > -wrap( Fn1 && fn1, Fn2 && fn2, - boost::context::execution_context const& ctx) { - return wrapper< Fn1, Fn2 >( - std::forward< Fn1 >( fn1), - std::forward< Fn2 >( fn2), - ctx); -} -#else template< typename Fn1, typename Fn2 > class wrapper { private: @@ -101,7 +57,6 @@ wrap( Fn1 && fn1, Fn2 && fn2) { std::forward< Fn1 >( fn1), std::forward< Fn2 >( fn2) ); } -#endif }}} |