1 Index: boost_1_64_0/boost/context/continuation.hpp
2 ===================================================================
3 --- boost_1_64_0.orig/boost/context/continuation.hpp 2017-04-24 12:36:55.987412031 +0100
4 +++ boost_1_64_0/boost/context/continuation.hpp 2017-04-24 12:37:49.730416122 +0100
12 template< typename T >
13 static T convert( T && t) noexcept {
21 +struct helper< std::tuple<U> > {
22 template< typename T >
23 static std::tuple< T > convert( T && t) noexcept {
24 return std::make_tuple( std::forward< T >( t) );
29 -template< typename Ctx, typename Fn, typename ... Arg >
30 +template< typename Ctx, typename Fn, typename Arg >
31 detail::transfer_t context_ontop( detail::transfer_t t) {
32 - auto p = static_cast< std::tuple< Fn, std::tuple< Arg ... > > * >( t.data);
33 + auto p = static_cast< Arg * >( t.data);
34 BOOST_ASSERT( nullptr != p);
35 typename std::decay< Fn >::type fn = std::forward< Fn >( std::get< 0 >( * p) );
36 t.data = & std::get< 1 >( * p);
38 // execute function, pass continuation via reference
39 - std::get< 1 >( * p) = detail::helper< sizeof ... (Arg) >::convert( fn( std::move( c) ) );
40 + typedef typename std::decay<decltype(std::get<1>(*p))>::type H;
41 + std::get< 1 >(* p) = detail::helper<H>::convert( fn( std::move( c) ) );
42 #if defined(BOOST_NO_CXX14_STD_EXCHANGE)
43 return { detail::exchange( c.t_.fctx, nullptr), & std::get< 1 >( * p) };
46 template< typename Ctx, typename StackAlloc, typename Fn >
47 friend class detail::record;
49 - template< typename Ctx, typename Fn, typename ... Arg >
50 + template< typename Ctx, typename Fn, typename Arg >
51 friend detail::transfer_t
52 context_ontop( detail::transfer_t);
55 template< typename Fn, typename ... Arg >
56 continuation resume_with( Fn && fn, Arg ... arg) {
57 BOOST_ASSERT( nullptr != t_.fctx);
58 - auto tpl = std::make_tuple( std::forward< Fn >( fn), std::forward< Arg >( arg) ... );
59 + auto tpl = std::make_tuple( std::forward< Fn >( fn), std::make_tuple( std::forward< Arg >( arg) ... ));
60 return detail::ontop_fcontext(
61 #if defined(BOOST_NO_CXX14_STD_EXCHANGE)
62 detail::exchange( t_.fctx, nullptr),
64 std::exchange( t_.fctx, nullptr),
67 - context_ontop< continuation, Fn, Arg ... >);
68 + context_ontop< continuation, Fn, decltype(tpl) >);
71 continuation resume() {
76 - typename = detail::disable_overload< continuation, Fn >
77 + typename = detail::disable_overload< continuation, Fn >,
78 + typename = detail::disable_overload< std::allocator_arg_t, Fn >
81 callcc( Fn && fn, Arg ... arg) {