Memory C++03
Added in 1.56.0

Boost.Align

Memory alignment functions, allocators, traits.

About Boost.Align

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

Dependencies

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

Boost.Align

The Boost Align C++ library provides functions, classes, templates, traits, and macros, for the control, inspection, and diagnostic of memory alignment.

License

Distributed under the Boost Software License, Version 1.0.

Latest Boost.Align posts

Join the Boost Developers Mailing List

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

All Contributors