Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

experimental::coro

The main type of a resumable coroutine.

template<
    typename Yield = void,
    typename Return = void,
    typename Executor = any_io_executor,
    typename Allocator = std::allocator<void>>
struct coro
Types

Name

Description

allocator_type

The allocator type.

completion_handler

Completion handler type used by async_resume.

error_type

The error type of the coroutine. Void for noexcept.

executor_type

The executor type.

input_type

The value that can be passed into a symmetrical cororoutine. void if asymmetrical.

promise_type

The internal promise-type of the coroutine.

result_type

The type received by a co_await or async_resume. Its a combination of yield and return.

return_type

The type that can be passed out through a co_return.

signature_type

The signature used by the async_resume.

traits

The traits of the coroutine. See boost::asio::experimental::coro_traits for details.

yield_type

The type that can be passed out through a co_yield.

Member Functions

Name

Description

async_resume

Resume the coroutine.

coro [constructor]

The default constructor, gives an invalid coroutine.

Move constructor.

get_allocator

Get the used allocator.

get_executor

Get the used executor.

is_open

Check whether the coroutine is open, i.e. can be resumed.

operator bool

Check whether the coroutine is open, i.e. can be resumed.

operator co_await

Operator used for coroutines without input value.

operator()

Operator used for coroutines with input value.

operator=

Move assignment.

~coro [destructor]

Destructor. Destroys the coroutine, if it holds a valid one.

Data Members

Name

Description

is_noexcept [static]

Whether or not the coroutine is noexcept.

Template parameter Yield specifies type or signature used by co_yield, Return specifies the type used for co_return, and Executor specifies the underlying executor type.

Requirements

Header: boost/asio/experimental/coro.hpp

Convenience header: None


PrevUpHomeNext