diff --git a/include/continuable/detail/core/base.hpp b/include/continuable/detail/core/base.hpp index 5af4712..618c81e 100644 --- a/include/continuable/detail/core/base.hpp +++ b/include/continuable/detail/core/base.hpp @@ -409,44 +409,59 @@ struct result_handler_base) noexcept { - return [](auto&& callback, exception_t&& error) { - // Errors are not partial invoked - // NOLINTNEXTLINE(hicpp-move-const-arg, performance-move-const-arg) - std::forward(callback)(std::move(error)); - }; + std::integral_constant) noexcept { +return; } inline auto make_exception_invoker( - std::integral_constant) noexcept { - return [](auto&& callback, exception_t&& error) { - // Errors are not partial invoked - std::forward(callback)( - exception_arg_t{}, - // NOLINTNEXTLINE(hicpp-move-const-arg, performance-move-const-arg) - std::move(error)); - }; + std::integral_constant) noexcept { +return; } +*/ -template -struct error_handler_base { - void operator()(exception_arg_t, exception_t error) && { - // Just invoke the error handler, cancel the calling hierarchy after - auto invoker = make_exception_invoker( - std::integral_constant{}); - - // Invoke the error handler - packed_dispatch( - std::move(static_cast(this)->executor_), std::move(invoker), - std::move(static_cast(this)->callback_), std::move(error)); - } -}; +template +struct error_handler_base; template struct error_handler_base { /// The operator which is called when an error occurred - void operator()(exception_arg_t tag, exception_t error) && { + void operator()(exception_arg_t tag, exception_t exception) && { // Forward the error to the next callback - std::move(static_cast(this)->next_callback_)(tag, std::move(error)); + std::move(static_cast(this)->next_callback_)(tag, + std::move(exception)); + } +}; +template +struct error_handler_base { + /// The operator which is called when an error occurred + void operator()(exception_arg_t, exception_t exception) && { + // Invoke the error handler + packed_dispatch( + std::move(static_cast(this)->executor_), + [](auto&& callback, exception_t exception) { + // Errors are not partial invoked + // NOLINTNEXTLINE(hicpp-move-const-arg, performance-move-const-arg) + std::forward(callback)(std::move(exception)); + }, + std::move(static_cast(this)->callback_), std::move(exception)); + } +}; +template +struct error_handler_base { + /// The operator which is called when an error occurred + void operator()(exception_arg_t, exception_t exception) && { + // Invoke the error handler + packed_dispatch( + std::move(static_cast(this)->executor_), + [](auto&& callback, exception_t exception) { + // Errors are not partial invoked + std::forward(callback)( + exception_arg_t{}, + // NOLINTNEXTLINE(hicpp-move-const-arg, + // performance-move-const-arg) + std::move(exception)); + }, + std::move(static_cast(this)->callback_), std::move(exception)); } }; } // namespace proto