mirror of
https://github.com/boostorg/leaf.git
synced 2026-02-02 08:52:13 +00:00
context_activator modified to avoid virtual function calls on context activation/deactivation
This commit is contained in:
@@ -1501,18 +1501,19 @@ namespace boost { namespace leaf {
|
||||
propagate_if_uncaught_exception
|
||||
};
|
||||
|
||||
template <class Ctx = polymorphic_context>
|
||||
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 <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, false>, 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>(f)(std::forward<A>(a)...);
|
||||
@@ -1716,7 +1717,7 @@ namespace boost { namespace leaf {
|
||||
template <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, true>, 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>(f)(std::forward<A>(a)...) )
|
||||
@@ -1745,14 +1746,14 @@ namespace boost { namespace leaf {
|
||||
template <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, false>, 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>(f)(std::forward<A>(a)...);
|
||||
}
|
||||
|
||||
template <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, true>, 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>(f)(std::forward<A>(a)...) )
|
||||
return r;
|
||||
else
|
||||
@@ -2216,11 +2217,11 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()().value())>::type remote_try_handle_all_( TryBlock &&, RemoteH && ) const;
|
||||
|
||||
template <class TryBlock, class... H>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type try_handle_some_( context_activator &, TryBlock &&, H && ... ) const;
|
||||
template <class TryBlock, class... H, class Ctx>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type try_handle_some_( context_activator<Ctx> &, TryBlock &&, H && ... ) const;
|
||||
|
||||
template <class TryBlock, class RemoteH>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type remote_try_handle_some_( context_activator &, TryBlock &&, RemoteH && ) const;
|
||||
template <class TryBlock, class RemoteH, class Ctx>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type remote_try_handle_some_( context_activator<Ctx> &, TryBlock &&, RemoteH && ) const;
|
||||
|
||||
public:
|
||||
|
||||
@@ -3210,8 +3211,8 @@ namespace boost { namespace leaf {
|
||||
}
|
||||
|
||||
template <class... E>
|
||||
template <class TryBlock, class... H>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::try_handle_some_( context_activator & active_context, TryBlock && try_block, H && ... h ) const
|
||||
template <class TryBlock, class... H, class Ctx>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::try_handle_some_( context_activator<Ctx> & active_context, TryBlock && try_block, H && ... h ) const
|
||||
{
|
||||
using namespace leaf_detail;
|
||||
static_assert(is_result_type<decltype(std::declval<TryBlock>()())>::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 <class... E>
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::remote_try_handle_some_( context_activator & active_context, TryBlock && try_block, RemoteH && h ) const
|
||||
template <class TryBlock, class RemoteH, class Ctx>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::remote_try_handle_some_( context_activator<Ctx> & active_context, TryBlock && try_block, RemoteH && h ) const
|
||||
{
|
||||
using namespace leaf_detail;
|
||||
static_assert(is_result_type<decltype(std::declval<TryBlock>()())>::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 <class TryBlock, class... H>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()().value())>::type nocatch_context<E...>::try_handle_all( TryBlock && try_block, H && ... h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::do_not_propagate);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::do_not_propagate);
|
||||
return this->try_handle_all_( std::forward<TryBlock>(try_block), std::forward<H>(h)... );
|
||||
}
|
||||
|
||||
@@ -3343,7 +3344,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()().value())>::type nocatch_context<E...>::remote_try_handle_all( TryBlock && try_block, RemoteH && h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::do_not_propagate);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::do_not_propagate);
|
||||
return this->remote_try_handle_all_( std::forward<TryBlock>(try_block), std::forward<RemoteH>(h) );
|
||||
}
|
||||
|
||||
@@ -3351,7 +3352,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class... H>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type nocatch_context<E...>::try_handle_some( TryBlock && try_block, H && ... h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
return this->try_handle_some_( active_context, std::forward<TryBlock>(try_block), std::forward<H>(h)... );
|
||||
}
|
||||
|
||||
@@ -3359,7 +3360,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type nocatch_context<E...>::remote_try_handle_some( TryBlock && try_block, RemoteH && h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
return this->remote_try_handle_some_( active_context, std::forward<TryBlock>(try_block), std::forward<RemoteH>(h) );
|
||||
}
|
||||
}
|
||||
@@ -3617,7 +3618,7 @@ namespace boost { namespace leaf {
|
||||
{
|
||||
using namespace leaf_detail;
|
||||
context_type_from_handlers<H...> ctx;
|
||||
context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<decltype(ctx)> 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<RemoteH> ctx;
|
||||
context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<decltype(ctx)> 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<decltype(std::declval<TryBlock>()())>::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<catch_context<E...>> 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<decltype(std::declval<TryBlock>()())>::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<catch_context<E...>> 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<decltype(std::declval<TryBlock>()())>::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<catch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
if( auto r = this->try_catch_(
|
||||
[&]
|
||||
{
|
||||
@@ -3743,7 +3744,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type catch_context<E...>::remote_try_handle_some( TryBlock && try_block, RemoteH && h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<catch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
if( auto r = this->remote_try_catch_(
|
||||
[&]
|
||||
{
|
||||
|
||||
@@ -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 <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, false>, 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>(f)(std::forward<A>(a)...);
|
||||
@@ -64,7 +64,7 @@ namespace boost { namespace leaf {
|
||||
template <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, true>, 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>(f)(std::forward<A>(a)...) )
|
||||
@@ -93,14 +93,14 @@ namespace boost { namespace leaf {
|
||||
template <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, false>, 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>(f)(std::forward<A>(a)...);
|
||||
}
|
||||
|
||||
template <class R, class F, class... A>
|
||||
inline decltype(std::declval<F>()(std::forward<A>(std::declval<A>())...)) capture_impl(is_result_tag<R, true>, 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>(f)(std::forward<A>(a)...) )
|
||||
return r;
|
||||
else
|
||||
|
||||
@@ -288,11 +288,11 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()().value())>::type remote_try_handle_all_( TryBlock &&, RemoteH && ) const;
|
||||
|
||||
template <class TryBlock, class... H>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type try_handle_some_( context_activator &, TryBlock &&, H && ... ) const;
|
||||
template <class TryBlock, class... H, class Ctx>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type try_handle_some_( context_activator<Ctx> &, TryBlock &&, H && ... ) const;
|
||||
|
||||
template <class TryBlock, class RemoteH>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type remote_try_handle_some_( context_activator &, TryBlock &&, RemoteH && ) const;
|
||||
template <class TryBlock, class RemoteH, class Ctx>
|
||||
typename std::decay<decltype(std::declval<TryBlock>()())>::type remote_try_handle_some_( context_activator<Ctx> &, TryBlock &&, RemoteH && ) const;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -779,8 +779,8 @@ namespace boost { namespace leaf {
|
||||
}
|
||||
|
||||
template <class... E>
|
||||
template <class TryBlock, class... H>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::try_handle_some_( context_activator & active_context, TryBlock && try_block, H && ... h ) const
|
||||
template <class TryBlock, class... H, class Ctx>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::try_handle_some_( context_activator<Ctx> & active_context, TryBlock && try_block, H && ... h ) const
|
||||
{
|
||||
using namespace leaf_detail;
|
||||
static_assert(is_result_type<decltype(std::declval<TryBlock>()())>::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 <class... E>
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::remote_try_handle_some_( context_activator & active_context, TryBlock && try_block, RemoteH && h ) const
|
||||
template <class TryBlock, class RemoteH, class Ctx>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type context_base<E...>::remote_try_handle_some_( context_activator<Ctx> & active_context, TryBlock && try_block, RemoteH && h ) const
|
||||
{
|
||||
using namespace leaf_detail;
|
||||
static_assert(is_result_type<decltype(std::declval<TryBlock>()())>::value, "The return type of the try_block passed to a remote_try_handle_some function must be registered with leaf::is_result_type");
|
||||
|
||||
@@ -757,18 +757,19 @@ namespace boost { namespace leaf {
|
||||
propagate_if_uncaught_exception
|
||||
};
|
||||
|
||||
template <class Ctx = polymorphic_context>
|
||||
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())
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class... H>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()().value())>::type nocatch_context<E...>::try_handle_all( TryBlock && try_block, H && ... h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::do_not_propagate);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::do_not_propagate);
|
||||
return this->try_handle_all_( std::forward<TryBlock>(try_block), std::forward<H>(h)... );
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()().value())>::type nocatch_context<E...>::remote_try_handle_all( TryBlock && try_block, RemoteH && h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::do_not_propagate);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::do_not_propagate);
|
||||
return this->remote_try_handle_all_( std::forward<TryBlock>(try_block), std::forward<RemoteH>(h) );
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class... H>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type nocatch_context<E...>::try_handle_some( TryBlock && try_block, H && ... h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
return this->try_handle_some_( active_context, std::forward<TryBlock>(try_block), std::forward<H>(h)... );
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type nocatch_context<E...>::remote_try_handle_some( TryBlock && try_block, RemoteH && h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<nocatch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
return this->remote_try_handle_some_( active_context, std::forward<TryBlock>(try_block), std::forward<RemoteH>(h) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace boost { namespace leaf {
|
||||
{
|
||||
using namespace leaf_detail;
|
||||
context_type_from_handlers<H...> ctx;
|
||||
context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<decltype(ctx)> 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<RemoteH> ctx;
|
||||
context_activator active_context(ctx, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<decltype(ctx)> 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<decltype(std::declval<TryBlock>()())>::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<catch_context<E...>> 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<decltype(std::declval<TryBlock>()())>::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<catch_context<E...>> 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<decltype(std::declval<TryBlock>()())>::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<catch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
if( auto r = this->try_catch_(
|
||||
[&]
|
||||
{
|
||||
@@ -250,7 +250,7 @@ namespace boost { namespace leaf {
|
||||
template <class TryBlock, class RemoteH>
|
||||
inline typename std::decay<decltype(std::declval<TryBlock>()())>::type catch_context<E...>::remote_try_handle_some( TryBlock && try_block, RemoteH && h )
|
||||
{
|
||||
context_activator active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
context_activator<catch_context<E...>> active_context(*this, on_deactivation::propagate_if_uncaught_exception);
|
||||
if( auto r = this->remote_try_catch_(
|
||||
[&]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user