Skip to content

Instantly share code, notes, and snippets.

View cstratopoulos's full-sized avatar
💭
😼

Lia Stratopoulos cstratopoulos

💭
😼
View GitHub Profile
@cstratopoulos
cstratopoulos / as_result.hpp
Last active September 27, 2023 07:15
Boost ASIO async_result for outcome type
/*
A Boost.ASIO async_result adapter for outcome (https://github.com/ned14/outcome)
Sample use:
boost::outcome_v2::result<std::size_t> read =
co_await stream.async_read(buffer, as_result(boost::asio::use_awaitable));
*/
#include <boost/asio/associated_allocator.hpp>