MCPcopy Create free account
hub / github.com/Naios/continuable / error_code_remapper

Function error_code_remapper

examples/example-asio/example-asio.cpp:47–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45using namespace std::chrono_literals;
46
47inline auto error_code_remapper() {
48 return [](auto&& promise, asio::error_code e, auto&&... args) {
49 if (e) {
50#if defined(CONTINUABLE_HAS_EXCEPTIONS)
51 promise.set_exception(std::make_exception_ptr(e));
52#else
53 promise.set_exception(cti::exception_t(e.value(), e.category()));
54#endif
55 } else {
56 promise.set_value(std::forward<decltype(args)>(args)...);
57 }
58 };
59}
60
61struct functional_io_service {
62 asio::io_context service_;

Callers 1

async_resolveMethod · 0.85

Calls 2

set_exceptionMethod · 0.45
set_valueMethod · 0.45

Tested by

no test coverage detected