Boost C++ Libraries

PrevUpHomeNext

Struct ignore_and_rethrow_t

boost::taar::ignore_and_rethrow_t — Completion handler that rethrows any reported exception.

Synopsis

// In header: <boost/taar/core/ignore_and_rethrow.hpp>


struct ignore_and_rethrow_t {

  // public member functions
  void operator()(std::exception_ptr const &);
};

Description

Intended as the completion token for co_spawn on a top-level coroutine, most usefully the boost::taar::server::tcp acceptor. A reported exception is rethrown into the surrounding scope so that io_context::run() returns and the program can shut down rather than silently swallowing the failure.

ignore_and_rethrow_t public member functions

  1. void operator()(std::exception_ptr const & eptr);

PrevUpHomeNext