v3 flag enabled
Containers C++03
Added in 1.16.1

Boost.Array

STL compliant container wrapper for arrays of constant size.

About Boost.Array

Boost.Demo is a header-only library for high-throughput message parsing with a modern, allocation-free API.

#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <iostream>

namespace beast = boost::beast;
namespace http = beast::http;

int main()
{
    // Build an HTTP GET request
    http::request<http::string_body> req{http::verb::get, "/index.html", 11};
    req.set(http::field::host, "www.example.com");
    req.set(http::field::user_agent, "Boost.Beast");

    std::cout << req << std::endl;

    // Build an HTTP response
    http::response<http::string_body> res{http::status::ok, 11};
    res.set(http::field::server, "Boost.Beast");
    res.set(http::field::content_type, "text/plain");
    res.body() = "Hello from Boost.Beast!";
    res.prepare_payload();

    std::cout << res << std::endl;

    return 0;
}

Benchmarks


Throughput (req/s)

Boost.Demo

Alternative A

Alternative B

Latency (microseconds)

Boost.Demo

Alternative A

Alternative B

This library is designed for

High-throughput parsing

Handles millions of messages per second with near-zero allocations on the hot path.

Header-only

Add Boost to your include path — no separate build step required.

Standards-tracking

APIs mirror the C++ standard where applicable, easing future migration.

Notes from the maintainer

Boost.Demo is maintained by the demo team. Highlights:

  • Zero-allocation fast path

  • Extensive fuzz testing

  • Works on all major compilers

See the Boost website for more.

Install

Header-only — add Boost to your include path, or build with b2.

# build it with b2:
./b2 --with-demo install
# then link against it:
g++ app.cpp -lboost_demo

Contributors: This Release


Documentation
⚠️ This library has no README.md or library-details.adoc; consider contributing one.

Latest Boost.Array posts

Join the Boost Developers Mailing List

Get the latest on releases, features, security patches, fixes and all major announcements.

All Contributors