Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

this_coro::cancellation_state

Awaitable object that returns the cancellation state of the current coroutine.

constexpr cancellation_state_t cancellation_state;
Example
boost::asio::awaitable<void> my_coroutine()
{
  boost::asio::cancellation_state cs
    = co_await boost::asio::this_coro::cancellation_state;

  // ...

  if (cs.cancelled() != boost::asio::cancellation_type::none)
    // ...
}
Requirements

Header: boost/asio/this_coro.hpp

Convenience header: boost/asio.hpp


PrevUpHomeNext