mcpp index

compat.boost-asio

#include

Boost.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

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// 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 · 项目 tests/examples/boost-asio

构建

targets
boost_asio (lib)
language
c++20
import std
no
include dirs
*/include

特性

特性声明了
defaultimplies
asio-configdefines

源文件 (1)

  • mcpp_generated/boost_asio_anchor.cpp

生成的文件

  • mcpp_generated/boost_asio_anchor.cpp

版本

版本平台 镜像sha256
1.92.0 最新 LinuxWindowsmacOS 源站 9aff35259a81…