mcpp index

compat.boost-beast

#include

Boost.Beast 1.92.0 — HTTP and WebSocket networking on Boost.Asio (header-only)

#include <boost/beast.hpp>
mcpp add compat.boost-beast@1.92.0

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// Behavioral test for compat.boost-beast, entirely offline: buffer types,
// HTTP request parsing, response serialize + parse round-trip, the error
// path on malformed input, the bundled zlib streams, and beast::static_string.
// Including the boost/beast.hpp aggregate forces one TU through core + http +
// websocket + zlib, which is what validates the whole modular-boost closure
// wiring (asio, system, mp11, intrusive, ...) against the 1.92.0 train.
#include <boost/beast.hpp>

#include <string>

int main() {
    namespace beast = boost::beast;
    namespace asio = boost::asio;
    namespace http = beast::http;
    namespace zlib = beast::zlib;
    bool ok = true;

    // beast's parser.put() returns the number of octets it parsed and the
    // caller must consume exactly that many from the dynamic buffer before
    // feeding the rest — the same contract http::read() implements on top.
    auto parse_all = [](auto& parser, beast::flat_buffer& buf) {
        beast::error_code ec;
// …

tests/examples/boost-beast/tests/beast.cpp · 專案 tests/examples/boost-beast

建置

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

功能

功能宣告了
defaultimplies
asio-configdefines

原始檔 (1)

  • mcpp_generated/boost_beast_anchor.cpp

產生的檔案

  • mcpp_generated/boost_beast_anchor.cpp

版本

版本平台 鏡像sha256
1.92.0 最新 LinuxWindowsmacOS 來源 de6f13081254…