compat.boost-asio
#includeBoost.Asio 1.92.0 — networking/async I/O; the boostorg tree consumed by Boost.Beast
#include <boost/asio.hpp>
mcpp add compat.boost-asio@1.92.0
Usage
From this repository's own test project — built and run by CI, not written for the website.
// Behavioral test for compat.boost-asio: a real steady_timer fires through a
// running io_context, post/defech queue in order, and the C++20 coroutine
// surface (co_spawn + awaitable) adds numbers. All offline, no sockets.
#include <boost/asio.hpp>
int main() {
namespace asio = boost::asio;
using asio::ip::tcp;
bool ok = true;
// 1. A steady_timer with a 1ms expiry actually wakes the io_context.
{
asio::io_context ctx;
bool fired = false;
asio::steady_timer timer(ctx, std::chrono::milliseconds(1));
timer.async_wait([&](const boost::system::error_code& ec) {
fired = !ec.failed();
});
ctx.run();
ok = ok && fired;
}
// …
tests/examples/boost-asio/tests/asio.cpp · project tests/examples/boost-asio
Build
- targets
boost_asio (lib)- language
c++20- import std
- no
- include dirs
*/include
Features
| feature | declares |
|---|---|
| default | implies |
| asio-config | defines |
Sources (1)
mcpp_generated/boost_asio_anchor.cpp
Generated files
mcpp_generated/boost_asio_anchor.cpp
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
1.92.0 latest |
LinuxWindowsmacOS | source | 9aff35259a81… |