boost

Boost Libraries

Boost C++ library patterns and conventions

Details

Language / Topic
cppC++
Category
framework
Compatible Frameworks
boost

Rules

balanced
- Use Boost libraries (Asio, Beast, Filesystem) when STL alternatives don't exist or are insufficient.
- Prefer STL equivalents when available (e.g., `std::filesystem` over `boost::filesystem` in C++17+).
- Use `boost::asio::io_context` as the central I/O event loop — post work with `boost::asio::post()` for thread-safe dispatch.
- Prefer `boost::beast` for HTTP/WebSocket — it builds on Asio and handles protocol framing without manual buffer management.
- Use Boost.Asio for async networking and I/O — use `io_context` as the event loop and `co_spawn` for coroutines.
- Use Boost.Beast for HTTP/WebSocket clients and servers built on top of Asio.
- Use Boost.Program_options for CLI argument parsing with type-safe option declarations.
- Use Boost.Log for structured logging with severity levels and sinks.