From 84df857c1001f7e2b82d5205d95e1b85e8174e83 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Wed, 30 Jan 2019 22:52:20 -0800 Subject: [PATCH] more "using", renamed capture_ to remote_ --- example/capture_in_exception.cpp | 10 +++--- example/capture_in_result.cpp | 10 +++--- include/boost/leaf/capture_in_exception.hpp | 4 +-- include/boost/leaf/capture_in_result.hpp | 4 +-- include/boost/leaf/detail/function_traits.hpp | 9 ++++++ include/boost/leaf/detail/static_store.hpp | 22 ++++++------- include/boost/leaf/exception_to_result.hpp | 2 +- include/boost/leaf/handle_all.hpp | 16 +++++----- include/boost/leaf/handle_some.hpp | 16 +++++----- include/boost/leaf/preload.hpp | 2 +- include/boost/leaf/try.hpp | 32 +++++++++---------- test/capture_in_exception_async_test.cpp | 10 +++--- ...capture_in_exception_result_async_test.cpp | 10 +++--- test/capture_in_exception_state_test.cpp | 10 +++--- test/capture_in_result_async_test.cpp | 10 +++--- test/capture_in_result_state_test.cpp | 10 +++--- test/function_traits_test.cpp | 12 +++---- 17 files changed, 99 insertions(+), 90 deletions(-) diff --git a/example/capture_in_exception.cpp b/example/capture_in_exception.cpp index a460403..b5cfa0d 100644 --- a/example/capture_in_exception.cpp +++ b/example/capture_in_exception.cpp @@ -47,9 +47,9 @@ int main() // The error_handler is called in this thread (see leaf::error_try_ below), eath time we get a future // from a worker that failed. The arguments passed to individual lambdas are transported from // the worker thread to the main thread automatically. - auto error_handler = [ ]( leaf::error_in_capture_try_ const & err ) + auto error_handler = [ ]( leaf::error_in_remote_try_ const & error ) { - return leaf::handle_error( err, + return leaf::handle_error( error, [ ]( e_failure_info1 const & v1, e_failure_info2 const & v2, e_thread_id const & tid ) { std::cerr << "Error in thread " << tid.value << "! failure_info1: " << v1.value << ", failure_info2: " << v2.value << std::endl; @@ -85,7 +85,7 @@ int main() { f.wait(); - leaf::capture_try_( + leaf::remote_try_( [&] { task_result r = f.get(); @@ -94,9 +94,9 @@ int main() std::cout << "Success!" << std::endl; (void) r; }, - [&]( leaf::error_in_capture_try_ const & err ) + [&]( leaf::error_in_remote_try_ const & error ) { - return error_handler(err); + return error_handler(error); } ); } } diff --git a/example/capture_in_result.cpp b/example/capture_in_result.cpp index c5a16c4..bf910fd 100644 --- a/example/capture_in_result.cpp +++ b/example/capture_in_result.cpp @@ -47,9 +47,9 @@ int main() // The error_handler is called in this thread (see leaf::error_handle_all below), eath time we get a // future from a worker that failed. The arguments passed to individual lambdas are transported // from the worker thread to the main thread automatically. - auto error_handler = [ ]( leaf::error_in_capture_handle_all const & err ) + auto error_handler = [ ]( leaf::error_in_remote_handle_all const & error ) { - return leaf::handle_error( err, + return leaf::handle_error( error, [ ]( e_failure_info1 const & v1, e_failure_info2 const & v2, e_thread_id const & tid ) { std::cerr << "Error in thread " << tid.value << "! failure_info1: " << v1.value << ", failure_info2: " << v2.value << std::endl; @@ -82,7 +82,7 @@ int main() { f.wait(); - leaf::capture_handle_all( + leaf::remote_handle_all( [&]() -> leaf::result { LEAF_AUTO(r,f.get()); @@ -92,9 +92,9 @@ int main() (void) r; return { }; }, - [&]( leaf::error_in_capture_handle_all const & err ) + [&]( leaf::error_in_remote_handle_all const & error ) { - return error_handler(err); + return error_handler(error); } ); } } diff --git a/include/boost/leaf/capture_in_exception.hpp b/include/boost/leaf/capture_in_exception.hpp index ebd47c2..f9488c9 100644 --- a/include/boost/leaf/capture_in_exception.hpp +++ b/include/boost/leaf/capture_in_exception.hpp @@ -219,7 +219,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; using R = decltype(std::declval()(std::forward(a)...)); - using StaticStore = deduce_static_store::return_type>>; + using StaticStore = deduce_static_store>>; StaticStore ss; return capture_in_exception_impl( result_tag(), std::move(ss), std::forward(f), std::forward(a)...); } @@ -229,7 +229,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; using R = decltype(std::declval()(std::forward(a)...)); - using StaticStore = deduce_static_store::return_type>>; + using StaticStore = deduce_static_store>>; StaticStore ss; return capture_in_exception_impl( alloc, result_tag(), std::move(ss), std::forward(f), std::forward(a)...); } diff --git a/include/boost/leaf/capture_in_result.hpp b/include/boost/leaf/capture_in_result.hpp index f6060a3..718b855 100644 --- a/include/boost/leaf/capture_in_result.hpp +++ b/include/boost/leaf/capture_in_result.hpp @@ -55,7 +55,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; using R = decltype(std::declval()(std::forward(a)...)); - using StaticStore = deduce_static_store::return_type>>; + using StaticStore = deduce_static_store>>; StaticStore ss; if( auto r = std::forward(f)(std::forward(a)...) ) return r; @@ -68,7 +68,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; using R = decltype(std::declval()(std::forward(a)...)); - using StaticStore = deduce_static_store::return_type>>; + using StaticStore = deduce_static_store>>; StaticStore ss; if( auto r = std::forward(f)(std::forward(a)...) ) return r; diff --git a/include/boost/leaf/detail/function_traits.hpp b/include/boost/leaf/detail/function_traits.hpp index b5730e8..7286013 100644 --- a/include/boost/leaf/detail/function_traits.hpp +++ b/include/boost/leaf/detail/function_traits.hpp @@ -68,6 +68,15 @@ namespace boost { namespace leaf { template struct function_traits : function_traits { }; template struct function_traits : function_traits { }; template struct function_traits : function_traits { }; + + template + using fn_return_type = typename function_traits::return_type; + + template + using fn_arg_type = typename function_traits::template arg::type; + + template + using fn_mp_args = typename function_traits::mp_args; } // namespace leaf_detail } } diff --git a/include/boost/leaf/detail/static_store.hpp b/include/boost/leaf/detail/static_store.hpp index 011b6ba..57e1c76 100644 --- a/include/boost/leaf/detail/static_store.hpp +++ b/include/boost/leaf/detail/static_store.hpp @@ -712,7 +712,7 @@ namespace boost { namespace leaf { } template - typename function_traits::return_type call_handler( error_info const & ei, F && f, leaf_detail_mp11::mp_list ) const + fn_return_type call_handler( error_info const & ei, F && f, leaf_detail_mp11::mp_list ) const { using namespace static_store_internal; return std::forward(f)( get_one_argument::type>::type>::get(s_, ei)... ); @@ -739,19 +739,19 @@ namespace boost { namespace leaf { } template - typename function_traits::return_type handle_error_( error_info const & ei, F && f ) const + fn_return_type handle_error_( error_info const & ei, F && f ) const { using namespace static_store_internal; - static_assert( handler_matches_any_error::mp_args>::value, "The last handler passed to handle_all must match any error." ); - return call_handler( ei, std::forward(f), typename function_traits::mp_args{ } ); + static_assert( handler_matches_any_error>::value, "The last handler passed to handle_all must match any error." ); + return call_handler( ei, std::forward(f), fn_mp_args{ } ); } template - typename function_traits::return_type handle_error_( error_info const & ei, CarF && car_f, CdrF && ... cdr_f ) const + fn_return_type handle_error_( error_info const & ei, CarF && car_f, CdrF && ... cdr_f ) const { using namespace static_store_internal; - if( handler_matches_any_error::mp_args>::value || check_handler( ei, typename function_traits::mp_args{ } ) ) - return call_handler( ei, std::forward(car_f), typename function_traits::mp_args{ } ); + if( handler_matches_any_error>::value || check_handler( ei, fn_mp_args{ } ) ) + return call_handler( ei, std::forward(car_f), fn_mp_args{ } ); else return handle_error_( ei, std::forward(cdr_f)...); } @@ -832,7 +832,7 @@ namespace boost { namespace leaf { { using type = transform_error_type_list< leaf_detail_mp11::mp_append< - typename function_traits::mp_args...>>; + fn_mp_args...>>; }; template @@ -846,7 +846,7 @@ namespace boost { namespace leaf { { using type = transform_error_type_list< leaf_detail_mp11::mp_append< - typename function_traits::mp_args...>>; + fn_mp_args...>>; }; template @@ -876,7 +876,7 @@ namespace boost { namespace leaf { //////////////////////////////////////// - template ::return_type, class HandlerArgs = typename function_traits::mp_args> + template , class HandlerArgs = fn_mp_args> struct handler_wrapper; template class L, class... A> @@ -916,7 +916,7 @@ namespace boost { namespace leaf { template struct handler_pack_return_impl { - using type = typename function_traits::return_type; + using type = fn_return_type; }; template diff --git a/include/boost/leaf/exception_to_result.hpp b/include/boost/leaf/exception_to_result.hpp index 73bd4b6..2325aba 100644 --- a/include/boost/leaf/exception_to_result.hpp +++ b/include/boost/leaf/exception_to_result.hpp @@ -50,7 +50,7 @@ namespace boost { namespace leaf { } template - leaf_detail::deduce_exception_to_result_return_type::return_type> exception_to_result( F && f ) noexcept + leaf_detail::deduce_exception_to_result_return_type> exception_to_result( F && f ) noexcept { try { diff --git a/include/boost/leaf/handle_all.hpp b/include/boost/leaf/handle_all.hpp index 1e9c31a..bc2c4c3 100644 --- a/include/boost/leaf/handle_all.hpp +++ b/include/boost/leaf/handle_all.hpp @@ -27,18 +27,18 @@ namespace boost { namespace leaf { //////////////////////////////////////// - struct error_in_capture_handle_all: error_info + struct error_in_remote_handle_all: error_info { void const * const ss_; - error_in_capture_handle_all( void const * ss, error_id const & id ) noexcept: + error_in_remote_handle_all( void const * ss, error_id const & id ) noexcept: error_info(id), ss_(ss) { assert(ss_!=0); } - error_in_capture_handle_all( void const * ss, std::error_code const & ec ) noexcept: + error_in_remote_handle_all( void const * ss, std::error_code const & ec ) noexcept: error_info(ec), ss_(ss) { @@ -47,24 +47,24 @@ namespace boost { namespace leaf { }; template - typename std::remove_reference()().value())>::type capture_handle_all( TryBlock && try_block, Handler && handler ) + typename std::remove_reference()().value())>::type remote_handle_all( TryBlock && try_block, Handler && handler ) { using namespace leaf_detail; using R = decltype(std::declval()()); static_assert(is_result_type::value, "The try_block passed to handle_all must be registered with leaf::is_result_type."); - deduce_static_store::return_type>> ss; + deduce_static_store>> ss; ss.set_reset(true); if( auto r = std::forward(try_block)() ) return r.value(); else - return std::forward(handler)(error_in_capture_handle_all(&ss, r.error())).get(); + return std::forward(handler)(error_in_remote_handle_all(&ss, r.error())).get(); } template - typename leaf_detail::handle_error_dispatch::result_type handle_error( error_in_capture_handle_all const & err, Handler && ... handler ) + typename leaf_detail::handle_error_dispatch::result_type handle_error( error_in_remote_handle_all const & error, Handler && ... handler ) { using namespace leaf_detail; - return handle_error_dispatch::handle(err, std::forward(handler)... ); + return handle_error_dispatch::handle(error, std::forward(handler)... ); } } } diff --git a/include/boost/leaf/handle_some.hpp b/include/boost/leaf/handle_some.hpp index d307dbd..a9adfc4 100644 --- a/include/boost/leaf/handle_some.hpp +++ b/include/boost/leaf/handle_some.hpp @@ -34,18 +34,18 @@ namespace boost { namespace leaf { //////////////////////////////////////// - struct error_in_capture_handle_some: error_info + struct error_in_remote_handle_some: error_info { void const * const ss_; - error_in_capture_handle_some( void const * ss, error_id const & id ) noexcept: + error_in_remote_handle_some( void const * ss, error_id const & id ) noexcept: error_info(id), ss_(ss) { assert(ss_!=0); } - error_in_capture_handle_some( void const * ss, std::error_code const & ec ) noexcept: + error_in_remote_handle_some( void const * ss, std::error_code const & ec ) noexcept: error_info(ec), ss_(ss) { @@ -54,12 +54,12 @@ namespace boost { namespace leaf { }; template - decltype(std::declval()()) capture_handle_some( TryBlock && try_block, Handler && handler ) + decltype(std::declval()()) remote_handle_some( TryBlock && try_block, Handler && handler ) { using namespace leaf_detail; using R = decltype(std::declval()()); static_assert(is_result_type::value, "The try_block passed to handle_some must be registered with leaf::is_result_type."); - deduce_static_store::return_type>> ss; + deduce_static_store>> ss; if( auto r = std::forward(try_block)() ) { ss.set_reset(true); @@ -67,7 +67,7 @@ namespace boost { namespace leaf { } else { - auto rr = std::forward(handler)(error_in_capture_handle_some(&ss, r.error())).get(); + auto rr = std::forward(handler)(error_in_remote_handle_some(&ss, r.error())).get(); if( rr ) ss.set_reset(true); return rr; @@ -75,10 +75,10 @@ namespace boost { namespace leaf { } template - typename leaf_detail::handle_error_dispatch::result_type handle_error( error_in_capture_handle_some const & err, Handler && ... handler ) + typename leaf_detail::handle_error_dispatch::result_type handle_error( error_in_remote_handle_some const & error, Handler && ... handler ) { using namespace leaf_detail; - return handle_error_dispatch::handle(err, std::forward(handler)... ); + return handle_error_dispatch::handle(error, std::forward(handler)... ); } } } diff --git a/include/boost/leaf/preload.hpp b/include/boost/leaf/preload.hpp index 9ba5af9..dc47e7f 100644 --- a/include/boost/leaf/preload.hpp +++ b/include/boost/leaf/preload.hpp @@ -211,7 +211,7 @@ namespace boost { namespace leaf { namespace leaf_detail { - template ::template arg<0>::type, int arity = function_traits::arity> + template , int arity = function_traits::arity> class accumulating_item; template diff --git a/include/boost/leaf/try.hpp b/include/boost/leaf/try.hpp index 5852aa9..0af7240 100644 --- a/include/boost/leaf/try.hpp +++ b/include/boost/leaf/try.hpp @@ -54,7 +54,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; deduce_static_store> ss; - auto throw_ = [ ]() -> typename function_traits::return_type { throw; }; + auto throw_ = [ ]() -> fn_return_type { throw; }; try { return call_try_block( result_tag()())>(), ss, std::forward(try_block), std::forward(handler)...); @@ -128,18 +128,18 @@ namespace boost { namespace leaf { } } - struct error_in_capture_try_: error_info + struct error_in_remote_try_: error_info { void const * const ss_; - error_in_capture_try_( void const * ss, error_id const & id, leaf_detail::exception_info_ const & ex ) noexcept: + error_in_remote_try_( void const * ss, error_id const & id, leaf_detail::exception_info_ const & ex ) noexcept: error_info(id, ex), ss_(ss) { assert(ss_!=0); } - error_in_capture_try_( void const * ss, std::error_code const & ec, leaf_detail::exception_info_ const & ex ) noexcept: + error_in_remote_try_( void const * ss, std::error_code const & ec, leaf_detail::exception_info_ const & ex ) noexcept: error_info(ec, ex), ss_(ss) { @@ -148,10 +148,10 @@ namespace boost { namespace leaf { }; template - decltype(std::declval()()) capture_try_( TryBlock && try_block, Handler && handler ) + decltype(std::declval()()) remote_try_( TryBlock && try_block, Handler && handler ) { using namespace leaf_detail; - deduce_static_store::return_type>> ss; + deduce_static_store>> ss; try { return error_call_try_block( result_tag()())>(), ss, std::forward(try_block), std::forward(handler)); @@ -165,42 +165,42 @@ namespace boost { namespace leaf { } catch( std::system_error const & ex ) { - return std::forward(handler)(error_in_capture_try_(&ss, ex.code(), exception_info_(&ex, &cap, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, ex.code(), exception_info_(&ex, &cap, &print_exception_info))).get(); } catch( std::exception const & ex ) { if( error_id const * id = dynamic_cast(&ex) ) - return std::forward(handler)(error_in_capture_try_(&ss, *id, exception_info_(&ex, &cap, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, *id, exception_info_(&ex, &cap, &print_exception_info))).get(); else - return std::forward(handler)(error_in_capture_try_(&ss, make_error_id(next_id()), exception_info_(&ex, &cap, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, make_error_id(next_id()), exception_info_(&ex, &cap, &print_exception_info))).get(); } catch(...) { - return std::forward(handler)(error_in_capture_try_(&ss, make_error_id(next_id()), exception_info_(0, &cap, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, make_error_id(next_id()), exception_info_(0, &cap, &print_exception_info))).get(); } } catch( std::system_error const & ex ) { - return std::forward(handler)(error_in_capture_try_(&ss, ex.code(), exception_info_(&ex, 0, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, ex.code(), exception_info_(&ex, 0, &print_exception_info))).get(); } catch( std::exception const & ex ) { if( error_id const * id = dynamic_cast(&ex) ) - return std::forward(handler)(error_in_capture_try_(&ss, *id, exception_info_(&ex, 0, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, *id, exception_info_(&ex, 0, &print_exception_info))).get(); else - return std::forward(handler)(error_in_capture_try_(&ss, make_error_id(next_id()), exception_info_(&ex, 0, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, make_error_id(next_id()), exception_info_(&ex, 0, &print_exception_info))).get(); } catch(...) { - return std::forward(handler)(error_in_capture_try_(&ss, make_error_id(next_id()), exception_info_(0, 0, &print_exception_info))).get(); + return std::forward(handler)(error_in_remote_try_(&ss, make_error_id(next_id()), exception_info_(0, 0, &print_exception_info))).get(); } } template - typename leaf_detail::handle_error_dispatch::result_type handle_error( error_in_capture_try_ const & err, Handler && ... handler ) + typename leaf_detail::handle_error_dispatch::result_type handle_error( error_in_remote_try_ const & error, Handler && ... handler ) { using namespace leaf_detail; - return handle_error_dispatch::handle_try_(err, std::forward(handler)... ); + return handle_error_dispatch::handle_try_(error, std::forward(handler)... ); } } } diff --git a/test/capture_in_exception_async_test.cpp b/test/capture_in_exception_async_test.cpp index bda0f20..3683695 100644 --- a/test/capture_in_exception_async_test.cpp +++ b/test/capture_in_exception_async_test.cpp @@ -47,9 +47,9 @@ std::vector launch_tasks( int task_count, F f ) int main() { - auto error_handler = [ ]( leaf::error_in_capture_try_ const & err, int a, int b ) + auto error_handler = [ ]( leaf::error_in_remote_try_ const & error, int a, int b ) { - return leaf::handle_error( err, + return leaf::handle_error( error, [&]( info<1> const & x1, info<2> const & x2 ) { BOOST_TEST_EQ(x1.value, a); @@ -74,14 +74,14 @@ int main() for( auto & f : fut ) { f.fut.wait(); - int r = leaf::capture_try_( + int r = leaf::remote_try_( [&] { return f.fut.get(); }, - [&]( leaf::error_in_capture_try_ const & err ) + [&]( leaf::error_in_remote_try_ const & error ) { - return error_handler(err, f.a, f.b); + return error_handler(error, f.a, f.b); } ); if( f.result>=0 ) BOOST_TEST_EQ(r, f.result); diff --git a/test/capture_in_exception_result_async_test.cpp b/test/capture_in_exception_result_async_test.cpp index 40d24bc..05a1518 100644 --- a/test/capture_in_exception_result_async_test.cpp +++ b/test/capture_in_exception_result_async_test.cpp @@ -48,9 +48,9 @@ std::vector launch_tasks( int task_count, F f ) int main() { - auto error_handler = [ ]( leaf::error_in_capture_handle_all const & err, int a, int b ) + auto error_handler = [ ]( leaf::error_in_remote_handle_all const & error, int a, int b ) { - return leaf::handle_error( err, + return leaf::handle_error( error, [&]( info<1> const & x1, info<2> const & x2 ) { BOOST_TEST_EQ(x1.value, a); @@ -75,14 +75,14 @@ int main() for( auto & f : fut ) { f.fut.wait(); - int r = leaf::capture_handle_all( + int r = leaf::remote_handle_all( [&] { return f.fut.get(); }, - [&]( leaf::error_in_capture_handle_all const & err ) + [&]( leaf::error_in_remote_handle_all const & error ) { - return error_handler(err, f.a, f.b); + return error_handler(error, f.a, f.b); } ); if( f.result>=0 ) BOOST_TEST_EQ(r, f.result); diff --git a/test/capture_in_exception_state_test.cpp b/test/capture_in_exception_state_test.cpp index 4df2d04..3614a26 100644 --- a/test/capture_in_exception_state_test.cpp +++ b/test/capture_in_exception_state_test.cpp @@ -38,9 +38,9 @@ namespace boost { namespace leaf { int main() { - auto error_handler = [ ]( leaf::error_in_capture_try_ const & err ) + auto error_handler = [ ]( leaf::error_in_remote_try_ const & error ) { - return leaf::handle_error( err, + return leaf::handle_error( error, [ ]( info<1>, info<3> ) { } ); @@ -61,14 +61,14 @@ int main() ep = std::current_exception(); } BOOST_TEST_EQ(count, 2); - leaf::capture_try_( + leaf::remote_try_( [&] { std::rethrow_exception(ep); }, - [&]( leaf::error_in_capture_try_ const & err ) + [&]( leaf::error_in_remote_try_ const & error ) { - return error_handler(err); + return error_handler(error); } ); ep = std::exception_ptr(); BOOST_TEST_EQ(count, 0); diff --git a/test/capture_in_result_async_test.cpp b/test/capture_in_result_async_test.cpp index d491e75..94a6b79 100644 --- a/test/capture_in_result_async_test.cpp +++ b/test/capture_in_result_async_test.cpp @@ -47,9 +47,9 @@ std::vector launch_tasks( int task_count, F f ) int main() { - auto error_handler = [ ]( leaf::error_in_capture_handle_all const & err, int a, int b ) + auto error_handler = [ ]( leaf::error_in_remote_handle_all const & error, int a, int b ) { - return leaf::handle_error( err, + return leaf::handle_error( error, [&]( info<1> const & x1, info<2> const & x2 ) { BOOST_TEST_EQ(x1.value, a); @@ -75,14 +75,14 @@ int main() for( auto & f : fut ) { f.fut.wait(); - int r = leaf::capture_handle_all( + int r = leaf::remote_handle_all( [&] { return f.fut.get(); }, - [&]( leaf::error_in_capture_handle_all const & err ) + [&]( leaf::error_in_remote_handle_all const & error ) { - return error_handler(err, f.a, f.b); + return error_handler(error, f.a, f.b); } ); if( f.result>=0 ) BOOST_TEST_EQ(r, f.result); diff --git a/test/capture_in_result_state_test.cpp b/test/capture_in_result_state_test.cpp index bf1490e..86b5967 100644 --- a/test/capture_in_result_state_test.cpp +++ b/test/capture_in_result_state_test.cpp @@ -38,9 +38,9 @@ namespace boost { namespace leaf { int main() { - auto handler = [ ]( leaf::error_in_capture_handle_all const & err ) + auto handler = [ ]( leaf::error_in_remote_handle_all const & error ) { - return leaf::handle_error( err, + return leaf::handle_error( error, [ ]( info<1>, info<3> ) { }, @@ -55,14 +55,14 @@ int main() return leaf::new_error( info<1>{}, info<3>{} ); } ); BOOST_TEST_EQ(count, 2); - leaf::capture_handle_all( + leaf::remote_handle_all( [&r] { return r; }, - [&]( leaf::error_in_capture_handle_all const & err ) + [&]( leaf::error_in_remote_handle_all const & error ) { - return handler(err); + return handler(error); } ); } BOOST_TEST_EQ(count, 0); diff --git a/test/function_traits_test.cpp b/test/function_traits_test.cpp index e6821e7..385ac76 100644 --- a/test/function_traits_test.cpp +++ b/test/function_traits_test.cpp @@ -13,12 +13,12 @@ void check_traits( F ) using namespace boost::leaf::leaf_detail; using boost::leaf::leaf_detail_mp11::mp_list; static_assert(function_traits::arity==4,"arity"); - static_assert(std::is_same::return_type,double>::value,"return_type"); - static_assert(std::is_same::template arg<0>::type,int>::value,"arg<0>"); - static_assert(std::is_same::template arg<1>::type,float>::value,"arg<1>"); - static_assert(std::is_same::template arg<2>::type,int const &>::value,"arg<2>"); - static_assert(std::is_same::template arg<3>::type,float &&>::value,"arg<3>"); - static_assert(std::is_same::mp_args,mp_list>::value,"mp_args"); + static_assert(std::is_same,double>::value,"return_type"); + static_assert(std::is_same,int>::value,"arg<0>"); + static_assert(std::is_same,float>::value,"arg<1>"); + static_assert(std::is_same,int const &>::value,"arg<2>"); + static_assert(std::is_same,float &&>::value,"arg<3>"); + static_assert(std::is_same,mp_list>::value,"mp_args"); } double f1( int, float, int const &, float && )