summaryrefslogtreecommitdiff
path: root/boost/coroutine2/detail/pull_control_block_ecv1.ipp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/coroutine2/detail/pull_control_block_ecv1.ipp')
-rw-r--r--boost/coroutine2/detail/pull_control_block_ecv1.ipp22
1 files changed, 7 insertions, 15 deletions
diff --git a/boost/coroutine2/detail/pull_control_block_ecv1.ipp b/boost/coroutine2/detail/pull_control_block_ecv1.ipp
index eb2ae2778f..77866041fe 100644
--- a/boost/coroutine2/detail/pull_control_block_ecv1.ipp
+++ b/boost/coroutine2/detail/pull_control_block_ecv1.ipp
@@ -20,6 +20,7 @@
#include <boost/coroutine2/detail/decay_copy.hpp>
#include <boost/coroutine2/detail/forced_unwind.hpp>
#include <boost/coroutine2/detail/state.hpp>
+#include <boost/coroutine2/detail/wrap.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
@@ -46,9 +47,7 @@ pull_coroutine< T >::control_block::control_block( context::preallocated palloc,
Fn && fn) :
#if defined(BOOST_NO_CXX14_GENERIC_LAMBDAS)
ctx{ std::allocator_arg, palloc, salloc,
- std::move(
- std::bind(
- [this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context & ctx, void *) mutable noexcept {
+ wrap( [this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context & ctx, void *) mutable noexcept {
// create synthesized push_coroutine< T >
typename push_coroutine< T >::control_block synthesized_cb{ this, ctx };
push_coroutine< T > synthesized{ & synthesized_cb };
@@ -72,8 +71,7 @@ pull_coroutine< T >::control_block::control_block( context::preallocated palloc,
BOOST_ASSERT_MSG( false, "pull_coroutine is complete");
},
std::forward< Fn >( fn),
- boost::context::execution_context::current(),
- std::placeholders::_1))},
+ boost::context::execution_context::current() ) },
#else
ctx{ std::allocator_arg, palloc, salloc,
[this,fn_=decay_copy( std::forward< Fn >( fn) ),ctx=boost::context::execution_context::current()] (void *) mutable noexcept {
@@ -197,9 +195,7 @@ pull_coroutine< T & >::control_block::control_block( context::preallocated pallo
Fn && fn) :
#if defined(BOOST_NO_CXX14_GENERIC_LAMBDAS)
ctx{ std::allocator_arg, palloc, salloc,
- std::move(
- std::bind(
- [this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context & ctx, void *) mutable noexcept {
+ wrap( [this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context & ctx, void *) mutable noexcept {
// create synthesized push_coroutine< T >
typename push_coroutine< T & >::control_block synthesized_cb{ this, ctx };
push_coroutine< T & > synthesized{ & synthesized_cb };
@@ -223,8 +219,7 @@ pull_coroutine< T & >::control_block::control_block( context::preallocated pallo
BOOST_ASSERT_MSG( false, "pull_coroutine is complete");
},
std::forward< Fn >( fn),
- boost::context::execution_context::current(),
- std::placeholders::_1))},
+ boost::context::execution_context::current() ) },
#else
ctx{ std::allocator_arg, palloc, salloc,
[this,fn_=decay_copy( std::forward< Fn >( fn) ),ctx=boost::context::execution_context::current()] (void *) mutable noexcept {
@@ -326,9 +321,7 @@ pull_coroutine< void >::control_block::control_block( context::preallocated pall
Fn && fn) :
#if defined(BOOST_NO_CXX14_GENERIC_LAMBDAS)
ctx{ std::allocator_arg, palloc, salloc,
- std::move(
- std::bind(
- [this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context & ctx, void *) mutable noexcept {
+ wrap( [this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context & ctx, void *) mutable noexcept {
// create synthesized push_coroutine< T >
typename push_coroutine< void >::control_block synthesized_cb{ this, ctx };
push_coroutine< void > synthesized{ & synthesized_cb };
@@ -352,8 +345,7 @@ pull_coroutine< void >::control_block::control_block( context::preallocated pall
BOOST_ASSERT_MSG( false, "pull_coroutine is complete");
},
std::forward< Fn >( fn),
- boost::context::execution_context::current(),
- std::placeholders::_1))},
+ boost::context::execution_context::current() ) },
#else
ctx{ std::allocator_arg, palloc, salloc,
[this,fn_=decay_copy( std::forward< Fn >( fn) ),ctx=boost::context::execution_context::current()] (void *) mutable noexcept {