2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-19 04:02:09 +00:00

2 Commits

Author SHA1 Message Date
Christopher Kohlhoff
1afbc5c12b Update copyright notices. 2025-03-04 22:57:26 +11:00
Christopher Kohlhoff
4b4487cbfe Add disposition_traits and no_error_t.
The disposition concept describes types that can be used to test whether
an asynchronous operation completed without error. This includes
error_code and exception_ptr, but can be extended to user types via
specialisation of the disposition_traits class template.

Generic code that is intended to work in terms of dispositions should
not use asio::disposition_traits directly, but instead:

* Test whether a disposition holds no error by comparing against
  asio::no_error (of type asio::no_error_t).

* Use asio::to_exception_ptr to convert a disposition to a
  std::exception_ptr.

* Use asio::throw_exception to throw an exception that corresponds to
  the disposition, after first testing the disposition against
  asio::no_error.

The asio::use_future completion token and asio::awaitable<>-based
coroutines have been updated to work generically in terms of
dispositions.
2024-10-30 22:59:32 +11:00