diff --git a/examples/asio_beast_leaf_rpc.cpp b/examples/asio_beast_leaf_rpc.cpp index 1d11985..fd93ed9 100644 --- a/examples/asio_beast_leaf_rpc.cpp +++ b/examples/asio_beast_leaf_rpc.cpp @@ -124,7 +124,7 @@ auto async_demo_rpc(AsyncStream &stream, ErrorContext &error_context, Completion void operator()(error_code ec, std::size_t /*bytes_transferred*/ = 0) { leaf::result result_continue_execution; { - leaf::context_activator active_context{m_error_context, leaf::on_deactivation::do_not_propagate}; + leaf::context_activator<> active_context{m_error_context, leaf::on_deactivation::do_not_propagate}; auto load = leaf::preload(e_last_operation{m_data.response ? "async_demo_rpc::continuation-write" : "async_demo_rpc::continuation-read"}); if (ec == http::error::end_of_stream) { @@ -540,9 +540,9 @@ int main(int argc, char **argv) { // Note: In case we wanted to add some additional information to the error associated with the result // we would need to activate the error-context // In this example this is not the case, so the next line is commented out. - // leaf::context_activator active_context(error_context, leaf::on_deactivation::do_not_propagate); + // leaf::context_activator<> active_context(error_context, leaf::on_deactivation::do_not_propagate); - leaf::context_activator active_context(error_context, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(error_context, leaf::on_deactivation::do_not_propagate); if (result) { std::cout << "Server: Client work completed successfully" << std::endl; rv = 0; diff --git a/include/boost/leaf/all.hpp b/include/boost/leaf/all.hpp index f9c95ae..3fb3585 100644 --- a/include/boost/leaf/all.hpp +++ b/include/boost/leaf/all.hpp @@ -1501,18 +1501,19 @@ namespace boost { namespace leaf { propagate_if_uncaught_exception }; + template class context_activator { context_activator( context_activator const & ) = delete; context_activator & operator=( context_activator const & ) = delete; - polymorphic_context & ctx_; + Ctx & ctx_; on_deactivation on_deactivate_; bool const ctx_was_active_; public: - context_activator( polymorphic_context & ctx, on_deactivation on_deactivate ) noexcept: + context_activator( Ctx & ctx, on_deactivation on_deactivate ) noexcept: ctx_(ctx), on_deactivate_(on_deactivate), ctx_was_active_(ctx_.is_active()) @@ -1685,7 +1686,7 @@ namespace boost { namespace leaf { [[noreturn]] void unload_and_rethrow_original_exception() const { - context_activator active_context(*ctx_, on_deactivation::propagate); + context_activator<> active_context(*ctx_, on_deactivation::propagate); std::rethrow_exception(ex_); } @@ -1698,7 +1699,7 @@ namespace boost { namespace leaf { template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); try { return std::forward(f)(std::forward(a)...); @@ -1716,7 +1717,7 @@ namespace boost { namespace leaf { template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); try { if( auto r = std::forward(f)(std::forward(a)...) ) @@ -1745,14 +1746,14 @@ namespace boost { namespace leaf { template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); return std::forward(f)(std::forward(a)...); } template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); if( auto r = std::forward(f)(std::forward(a)...) ) return r; else @@ -2216,11 +2217,11 @@ namespace boost { namespace leaf { template typename std::decay()().value())>::type remote_try_handle_all_( TryBlock &&, RemoteH && ) const; - template - typename std::decay()())>::type try_handle_some_( context_activator &, TryBlock &&, H && ... ) const; + template + typename std::decay()())>::type try_handle_some_( context_activator &, TryBlock &&, H && ... ) const; - template - typename std::decay()())>::type remote_try_handle_some_( context_activator &, TryBlock &&, RemoteH && ) const; + template + typename std::decay()())>::type remote_try_handle_some_( context_activator &, TryBlock &&, RemoteH && ) const; public: @@ -3210,8 +3211,8 @@ namespace boost { namespace leaf { } template - template - inline typename std::decay()())>::type context_base::try_handle_some_( context_activator & active_context, TryBlock && try_block, H && ... h ) const + template + inline typename std::decay()())>::type context_base::try_handle_some_( context_activator & active_context, TryBlock && try_block, H && ... h ) const { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); @@ -3228,8 +3229,8 @@ namespace boost { namespace leaf { } template - template - inline typename std::decay()())>::type context_base::remote_try_handle_some_( context_activator & active_context, TryBlock && try_block, RemoteH && h ) const + template + inline typename std::decay()())>::type context_base::remote_try_handle_some_( context_activator & active_context, TryBlock && try_block, RemoteH && h ) const { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a remote_try_handle_some function must be registered with leaf::is_result_type"); @@ -3335,7 +3336,7 @@ namespace boost { namespace leaf { template inline typename std::decay()().value())>::type nocatch_context::try_handle_all( TryBlock && try_block, H && ... h ) { - context_activator active_context(*this, on_deactivation::do_not_propagate); + context_activator> active_context(*this, on_deactivation::do_not_propagate); return this->try_handle_all_( std::forward(try_block), std::forward(h)... ); } @@ -3343,7 +3344,7 @@ namespace boost { namespace leaf { template inline typename std::decay()().value())>::type nocatch_context::remote_try_handle_all( TryBlock && try_block, RemoteH && h ) { - context_activator active_context(*this, on_deactivation::do_not_propagate); + context_activator> active_context(*this, on_deactivation::do_not_propagate); return this->remote_try_handle_all_( std::forward(try_block), std::forward(h) ); } @@ -3351,7 +3352,7 @@ namespace boost { namespace leaf { template inline typename std::decay()())>::type nocatch_context::try_handle_some( TryBlock && try_block, H && ... h ) { - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); return this->try_handle_some_( active_context, std::forward(try_block), std::forward(h)... ); } @@ -3359,7 +3360,7 @@ namespace boost { namespace leaf { template inline typename std::decay()())>::type nocatch_context::remote_try_handle_some( TryBlock && try_block, RemoteH && h ) { - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); return this->remote_try_handle_some_( active_context, std::forward(try_block), std::forward(h) ); } } @@ -3617,7 +3618,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; context_type_from_handlers ctx; - context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); + context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); return ctx.try_catch_( [&] { @@ -3631,7 +3632,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; context_type_from_remote_handler ctx; - context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); + context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); return ctx.remote_try_catch_( [&] { @@ -3686,7 +3687,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->try_catch_( [&] { @@ -3704,7 +3705,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->remote_try_catch_( [&] { @@ -3722,7 +3723,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->try_catch_( [&] { @@ -3743,7 +3744,7 @@ namespace boost { namespace leaf { template inline typename std::decay()())>::type catch_context::remote_try_handle_some( TryBlock && try_block, RemoteH && h ) { - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->remote_try_catch_( [&] { diff --git a/include/boost/leaf/capture.hpp b/include/boost/leaf/capture.hpp index bfab27d..64ec8f0 100644 --- a/include/boost/leaf/capture.hpp +++ b/include/boost/leaf/capture.hpp @@ -33,7 +33,7 @@ namespace boost { namespace leaf { [[noreturn]] void unload_and_rethrow_original_exception() const { - context_activator active_context(*ctx_, on_deactivation::propagate); + context_activator<> active_context(*ctx_, on_deactivation::propagate); std::rethrow_exception(ex_); } @@ -46,7 +46,7 @@ namespace boost { namespace leaf { template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); try { return std::forward(f)(std::forward(a)...); @@ -64,7 +64,7 @@ namespace boost { namespace leaf { template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); try { if( auto r = std::forward(f)(std::forward(a)...) ) @@ -93,14 +93,14 @@ namespace boost { namespace leaf { template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); return std::forward(f)(std::forward(a)...); } template inline decltype(std::declval()(std::forward(std::declval())...)) capture_impl(is_result_tag, context_ptr const & ctx, F && f, A... a) { - context_activator active_context(*ctx, on_deactivation::do_not_propagate); + context_activator<> active_context(*ctx, on_deactivation::do_not_propagate); if( auto r = std::forward(f)(std::forward(a)...) ) return r; else diff --git a/include/boost/leaf/context.hpp b/include/boost/leaf/context.hpp index 2356a01..974e087 100644 --- a/include/boost/leaf/context.hpp +++ b/include/boost/leaf/context.hpp @@ -288,11 +288,11 @@ namespace boost { namespace leaf { template typename std::decay()().value())>::type remote_try_handle_all_( TryBlock &&, RemoteH && ) const; - template - typename std::decay()())>::type try_handle_some_( context_activator &, TryBlock &&, H && ... ) const; + template + typename std::decay()())>::type try_handle_some_( context_activator &, TryBlock &&, H && ... ) const; - template - typename std::decay()())>::type remote_try_handle_some_( context_activator &, TryBlock &&, RemoteH && ) const; + template + typename std::decay()())>::type remote_try_handle_some_( context_activator &, TryBlock &&, RemoteH && ) const; public: diff --git a/include/boost/leaf/detail/handle.hpp b/include/boost/leaf/detail/handle.hpp index 0172f72..eda512a 100644 --- a/include/boost/leaf/detail/handle.hpp +++ b/include/boost/leaf/detail/handle.hpp @@ -779,8 +779,8 @@ namespace boost { namespace leaf { } template - template - inline typename std::decay()())>::type context_base::try_handle_some_( context_activator & active_context, TryBlock && try_block, H && ... h ) const + template + inline typename std::decay()())>::type context_base::try_handle_some_( context_activator & active_context, TryBlock && try_block, H && ... h ) const { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); @@ -797,8 +797,8 @@ namespace boost { namespace leaf { } template - template - inline typename std::decay()())>::type context_base::remote_try_handle_some_( context_activator & active_context, TryBlock && try_block, RemoteH && h ) const + template + inline typename std::decay()())>::type context_base::remote_try_handle_some_( context_activator & active_context, TryBlock && try_block, RemoteH && h ) const { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a remote_try_handle_some function must be registered with leaf::is_result_type"); diff --git a/include/boost/leaf/error.hpp b/include/boost/leaf/error.hpp index 05b3b1a..f9e3fee 100644 --- a/include/boost/leaf/error.hpp +++ b/include/boost/leaf/error.hpp @@ -757,18 +757,19 @@ namespace boost { namespace leaf { propagate_if_uncaught_exception }; + template class context_activator { context_activator( context_activator const & ) = delete; context_activator & operator=( context_activator const & ) = delete; - polymorphic_context & ctx_; + Ctx & ctx_; on_deactivation on_deactivate_; bool const ctx_was_active_; public: - context_activator( polymorphic_context & ctx, on_deactivation on_deactivate ) noexcept: + context_activator( Ctx & ctx, on_deactivation on_deactivate ) noexcept: ctx_(ctx), on_deactivate_(on_deactivate), ctx_was_active_(ctx_.is_active()) diff --git a/include/boost/leaf/handle_error.hpp b/include/boost/leaf/handle_error.hpp index 177104f..2a8b912 100644 --- a/include/boost/leaf/handle_error.hpp +++ b/include/boost/leaf/handle_error.hpp @@ -16,7 +16,7 @@ namespace boost { namespace leaf { template inline typename std::decay()().value())>::type nocatch_context::try_handle_all( TryBlock && try_block, H && ... h ) { - context_activator active_context(*this, on_deactivation::do_not_propagate); + context_activator> active_context(*this, on_deactivation::do_not_propagate); return this->try_handle_all_( std::forward(try_block), std::forward(h)... ); } @@ -24,7 +24,7 @@ namespace boost { namespace leaf { template inline typename std::decay()().value())>::type nocatch_context::remote_try_handle_all( TryBlock && try_block, RemoteH && h ) { - context_activator active_context(*this, on_deactivation::do_not_propagate); + context_activator> active_context(*this, on_deactivation::do_not_propagate); return this->remote_try_handle_all_( std::forward(try_block), std::forward(h) ); } @@ -32,7 +32,7 @@ namespace boost { namespace leaf { template inline typename std::decay()())>::type nocatch_context::try_handle_some( TryBlock && try_block, H && ... h ) { - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); return this->try_handle_some_( active_context, std::forward(try_block), std::forward(h)... ); } @@ -40,7 +40,7 @@ namespace boost { namespace leaf { template inline typename std::decay()())>::type nocatch_context::remote_try_handle_some( TryBlock && try_block, RemoteH && h ) { - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); return this->remote_try_handle_some_( active_context, std::forward(try_block), std::forward(h) ); } } diff --git a/include/boost/leaf/handle_exception.hpp b/include/boost/leaf/handle_exception.hpp index b1454ab..b2d7eb3 100644 --- a/include/boost/leaf/handle_exception.hpp +++ b/include/boost/leaf/handle_exception.hpp @@ -124,7 +124,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; context_type_from_handlers ctx; - context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); + context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); return ctx.try_catch_( [&] { @@ -138,7 +138,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; context_type_from_remote_handler ctx; - context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); + context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception); return ctx.remote_try_catch_( [&] { @@ -193,7 +193,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->try_catch_( [&] { @@ -211,7 +211,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->remote_try_catch_( [&] { @@ -229,7 +229,7 @@ namespace boost { namespace leaf { { using namespace leaf_detail; static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->try_catch_( [&] { @@ -250,7 +250,7 @@ namespace boost { namespace leaf { template inline typename std::decay()())>::type catch_context::remote_try_handle_some( TryBlock && try_block, RemoteH && h ) { - context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception); + context_activator> active_context(*this, on_deactivation::propagate_if_uncaught_exception); if( auto r = this->remote_try_catch_( [&] { diff --git a/test/context_activator_test.cpp b/test/context_activator_test.cpp index 619fa2e..a431575 100644 --- a/test/context_activator_test.cpp +++ b/test/context_activator_test.cpp @@ -19,7 +19,7 @@ struct info template leaf::result f( Ctx & ctx ) { - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); return leaf::new_error( info<1>{1} ); } @@ -43,7 +43,7 @@ int main() [&] { auto ctx = leaf::make_context(&handle_error); - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); return f(ctx); }, [&]( leaf::error_info const & error ) diff --git a/test/continuation_test.cpp b/test/continuation_test.cpp index 3847d76..022eb3a 100644 --- a/test/continuation_test.cpp +++ b/test/continuation_test.cpp @@ -70,7 +70,7 @@ struct io_task_context asio::post( io_ctx, [=]() mutable { - leaf::context_activator active_context(*err_ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(*err_ctx, leaf::on_deactivation::do_not_propagate); f(); } ); } diff --git a/test/ctx_remote_handle_all_test.cpp b/test/ctx_remote_handle_all_test.cpp index e3cac93..ec42dc8 100644 --- a/test/ctx_remote_handle_all_test.cpp +++ b/test/ctx_remote_handle_all_test.cpp @@ -20,7 +20,7 @@ struct info template leaf::result f( Ctx & ctx ) { - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); return leaf::new_error( info<1>{1} ); } diff --git a/test/ctx_remote_handle_exception_test.cpp b/test/ctx_remote_handle_exception_test.cpp index bce8afd..814ce4f 100644 --- a/test/ctx_remote_handle_exception_test.cpp +++ b/test/ctx_remote_handle_exception_test.cpp @@ -31,7 +31,7 @@ struct info template void f( Ctx & ctx ) { - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); throw leaf::exception(std::exception(), info<1>{1}); } diff --git a/test/ctx_remote_handle_some_test.cpp b/test/ctx_remote_handle_some_test.cpp index 066ee0e..e7aea62 100644 --- a/test/ctx_remote_handle_some_test.cpp +++ b/test/ctx_remote_handle_some_test.cpp @@ -19,7 +19,7 @@ struct info template leaf::result f( Ctx & ctx ) { - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); return leaf::new_error( info<1>{1} ); } diff --git a/test/result_state_test.cpp b/test/result_state_test.cpp index 3cbc7bf..3d95f57 100644 --- a/test/result_state_test.cpp +++ b/test/result_state_test.cpp @@ -406,7 +406,7 @@ int main() { // error move -> copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -419,7 +419,7 @@ int main() BOOST_TEST_EQ(val::count, 0); { // error copy -> copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1); @@ -434,7 +434,7 @@ int main() { // error move -> move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -447,7 +447,7 @@ int main() BOOST_TEST_EQ(val::count, 0); { // error copy -> move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1); @@ -462,7 +462,7 @@ int main() { // error move -> assign copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -475,7 +475,7 @@ int main() BOOST_TEST_EQ(val::count, 0); { // error copy -> assign copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1); @@ -490,7 +490,7 @@ int main() { // error move -> assign move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -508,7 +508,7 @@ int main() BOOST_TEST_EQ(val::count, 0); { // error copy -> assign move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1); @@ -680,7 +680,7 @@ int main() { // void error move -> copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -691,7 +691,7 @@ int main() BOOST_TEST_EQ(err::count, 0); { // void error copy -> copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1); @@ -704,7 +704,7 @@ int main() { // void error move -> move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::do_not_propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::do_not_propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -715,7 +715,7 @@ int main() BOOST_TEST_EQ(err::count, 0); { // void error copy -> move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1); @@ -728,7 +728,7 @@ int main() { // void error move -> assign copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -739,7 +739,7 @@ int main() BOOST_TEST_EQ(err::count, 0); { // void error copy -> assign copy leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1); @@ -752,7 +752,7 @@ int main() { // void error move -> assign move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::result r1 = leaf::new_error( e_err { } ); BOOST_TEST(!r1); BOOST_TEST_EQ(err::count, 1); @@ -764,7 +764,7 @@ int main() BOOST_TEST_EQ(err::count, 0); { // void error copy -> assign move leaf::context ctx; - leaf::context_activator active_context(ctx, leaf::on_deactivation::propagate); + leaf::context_activator<> active_context(ctx, leaf::on_deactivation::propagate); leaf::error_id err = leaf::new_error( e_err{ } ); leaf::result r1 = err; BOOST_TEST(!r1);