How boostorg/units works
Main Components
a. Core Library
• /boost/units (all headers: base dimensions, base units, derived units, systems, conversions, quantity, etc.)
• detail/ sub-directory (internal implementation)
b. Build System
• CMakeLists.txt
• Boost.Build files (build.jam, Jamfiles in test/, doc/, example/)
• config scripts (covscan.sh)
c. Documentation Pipeline
• doc/ (QuickBook sources)
• images/
• index.html (output)
d. Examples
• example/ (sample C++ programs illustrating usage)
e. Tests
• test/ (unit tests exercising compile-time and runtime correctness)
• test_headers/ (header-only self-containment tests)
• tutorial/ (tutorial code)
f. Continuous Integration
• Travis CI (.travis.yml)
• AppVeyor (appveyor.yml)
• Coverity Scan integration
Relationships and Data Flows
• Build System orchestrates:
• Compilation of examples and tests
• Generation of documentation from QuickBook sources
• Packaging of include/ files
• CI pipelines trigger Build System on push to master/develop, run tests, build docs, report status.
Architectural Patterns & Design Principles
• Header-Only Library: all code resides in include/ and is instantiated at compile time—no binary library produced.
• Metaprogramming: heavy use of TMP in detail/ and dimension/unit definitions.
• Modular Organization:
• Base dimensions and units (angle, length, mass, time…)
• Physical dimensions (force, energy, power…)
• Systems (SI, CGS, Imperial, US, astronomical…)
• Conversion utilities
• I/O support
• Extensibility Points: Users can add new units or systems by dropping headers into include/boost/units/base_units or by providing custom dimensions.
Technologies & External Dependencies
• C++14/C++17 compiler
• Boost.Build (bjam) and CMake for multi-platform build
• QuickBook for documentation
• Travis CI and AppVeyor for CI
• Coverity Scan for static analysis
• Optional: covscan.sh for Coverity scripting
Detail Level
• Essential components and flows: library headers, build, tests, docs, CI.
• Avoid clutter: show representative examples of units (e.g., SI base units, derived dimensions) rather than listing dozens of headers.