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…