diff --git a/include/boost/fiber/context.hpp b/include/boost/fiber/context.hpp index 3eb3d2e4..134bf84a 100644 --- a/include/boost/fiber/context.hpp +++ b/include/boost/fiber/context.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -261,7 +262,7 @@ public: use_count_( 1), // fiber instance or scheduler owner flags_( flag_worker_context), scheduler_( nullptr), - ctx_( palloc, salloc, + ctx_( std::allocator_arg, palloc, salloc, // mutable: generated operator() is not const -> enables std::move( fn) // std::make_tuple: stores decayed copies of its args, implicitly unwraps std::reference_wrapper [=,fn=std::forward< Fn >( fn),tpl=std::make_tuple( std::forward< Args >( args) ...)] () mutable -> void { diff --git a/src/context.cpp b/src/context.cpp index 859dba58..096981b5 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -76,7 +76,7 @@ context::context( dispatcher_context_t, boost::context::preallocated const& pall use_count_( 0), // scheduler will own dispatcher context flags_( flag_dispatcher_context), scheduler_( nullptr), - ctx_( palloc, salloc, + ctx_( std::allocator_arg, palloc, salloc, [=] () -> void { // execute scheduler::dispatch() sched->dispatch();