Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Boost 1.67.0 Library Documentation

Sort by:

By Category

String and text processing

  • Regex: Regular expression library.
  • Lexical Cast: General literal text conversions, such as an int represented a string, or vice-versa.
  • Tokenizer: Break of a string or other character sequence into a series of tokens.
  • Format: The format library provides a type-safe mechanism for formatting arguments according to a printf-like format-string.
  • Spirit: LL parser framework represents parsers directly as EBNF grammars in inlined C++.
  • String Algo: String algorithms library.
  • Iostreams: Boost.IOStreams provides a framework for defining streams, stream buffers and i/o filters.
  • Wave: The Boost.Wave library is a Standards conformant, and highly configurable implementation of the mandated C99/C++ preprocessor functionality packed behind an easy to use iterator interface.
  • Xpressive: Regular expressions that can be written as strings or as expression templates, and which can refer to each other and themselves recursively with the power of context-free grammars.
  • Locale: Provide localization and Unicode handling tools for C++.
  • Convert: An extendible and configurable type-conversion framework.

Containers

  • Array: STL compliant container wrapper for arrays of constant size.
  • Graph: The BGL graph interface and graph components are generic, in the same sense as the the Standard Template Library (STL).
  • Property Map: Concepts defining interfaces which map key objects to value objects.
  • Multi-Array: Boost.MultiArray provides a generic N-dimensional array concept definition and common implementations of that interface.
  • Dynamic Bitset: The dynamic_bitset class represents a set of bits. It provides accesses to the value of individual bits via an operator[] and provides all of the bitwise operators that one can apply to builtin integers, such as operator& and operator<<. The number of bits in the set is specified at runtime via a parameter to the constructor of the dynamic_bitset.
  • Variant: Safe, generic, stack-based discriminated union container.
  • Multi-Index: The Boost Multi-index Containers Library provides a class template named multi_index_container which enables the construction of containers maintaining one or more indices with different sorting and access semantics.
  • Pointer Container: Containers for storing heap-allocated polymorphic objects to ease OO-programming.
  • Bimap: Bidirectional maps library for C++. With Boost.Bimap you can create associative containers in which both types can be used as key.
  • Circular Buffer: A STL compliant container also known as ring or cyclic buffer.
  • GIL: Generic Image Library
  • Intrusive: Intrusive containers and algorithms.
  • Unordered: Unordered associative containers.
  • GraphParallel: The PBGL graph interface and graph components are generic, in the same sense as the the Standard Template Library (STL).
  • Property Tree: A tree data structure especially suited to storing configuration data.
  • ICL: Interval Container Library, interval sets and maps and aggregation of associated values
  • Container: Standard library containers and extensions.
  • PolyCollection: Fast containers of polymorphic objects.

Iterators

  • Operators: Templates ease arithmetic classes and iterators.
  • Graph: The BGL graph interface and graph components are generic, in the same sense as the the Standard Template Library (STL).
  • Iterator: The Boost Iterator Library contains two parts. The first is a system of concepts which extend the C++ standard iterator requirements. The second is a framework of components for building iterators based on these extended concepts and includes several useful iterator adaptors.
  • Tokenizer: Break of a string or other character sequence into a series of tokens.
  • GIL: Generic Image Library
  • GraphParallel: The PBGL graph interface and graph components are generic, in the same sense as the the Standard Template Library (STL).

Algorithms

  • Utility: Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom.
  • Graph: The BGL graph interface and graph components are generic, in the same sense as the the Standard Template Library (STL).
  • Range: A new infrastructure for generic algorithms that builds on top of the new iterator concepts.
  • String Algo: String algorithms library.
  • Min-Max: Standard library extensions for simultaneous min/max and min/max element computations.
  • Foreach: In C++, writing a loop that iterates over a sequence is tedious. We can either use iterators, which requires a considerable amount of boiler-plate, or we can use the std::for_each() algorithm and move our loop body into a predicate, which requires no less boiler-plate and forces us to move our logic far from where it will be used. In contrast, some other languages, like Perl, provide a dedicated "foreach" construct that automates this process. BOOST_FOREACH is just such a construct for C++. It iterates over sequences for us, freeing us from having to deal directly with iterators or write predicates.
  • GIL: Generic Image Library
  • GraphParallel: The PBGL graph interface and graph components are generic, in the same sense as the the Standard Template Library (STL).
  • Polygon: Voronoi diagram construction and booleans/clipping, resizing/offsetting and more for planar polygons with integral coordinates.
  • Geometry: The Boost.Geometry library provides geometric algorithms, primitives and spatial index.
  • Algorithm: A collection of useful generic algorithms.
  • Sort: High-performance templated sort functions.
  • QVM: Boost QVM is a generic library for working with quaternions, vectors and matrices of static size with the emphasis on 2, 3 and 4-dimensional operations needed in graphics, video games and simulation applications.

Function objects and higher-order programming

  • Utility: Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom.
  • Functional: The Boost.Function library contains a family of class templates that are function object wrappers.
  • Function: Function object wrappers for deferred calls or callbacks.
  • Member Function: Generalized binders for function/object/pointers and member functions.
  • Ref: A utility library for passing references to generic functions.
  • Bind: boost::bind is a generalization of the standard functions std::bind1st and std::bind2nd. It supports arbitrary function objects, functions, function pointers, and member function pointers, and is able to bind any argument to a specific value or route input arguments into arbitrary positions.
  • Lambda: Define small unnamed function objects at the actual call site, and more.
  • Signals (deprecated): Managed signals & slots callback implementation.
  • Result Of: Determines the type of a function call expression.
  • Container Hash: An STL-compatible hash function object that can be extended to hash user defined types.
  • Signals2: Managed signals & slots callback implementation (thread-safe version 2).
  • Functional/Factory: Function object templates for dynamic and static object creation
  • Functional/Forward: Adapters to allow generic function objects to accept arbitrary arguments
  • Phoenix: Define small unnamed function objects at the actual call site, and more.
  • Local Function: Program functions locally, within other functions, directly within the scope where they are needed.
  • Functional/Overloaded Function: Overload different functions into a single function object.
  • HOF: Higher-order functions for C++

Generic Programming

  • Operators: Templates ease arithmetic classes and iterators.
  • Type Traits: Templates for fundamental properties of types.
  • Call Traits: Defines types for passing parameters.
  • Concept Check: Tools for generic programming.
  • Static Assert: Static assertions (compile time assertions).
  • Property Map: Concepts defining interfaces which map key objects to value objects.
  • Enable If: Selective inclusion of function template overloads.
  • In Place Factory, Typed In Place Factory: Generic in-place construction of contained objects with a variadic argument-list.
  • Function Types: Boost.FunctionTypes provides functionality to classify, decompose and synthesize function, function pointer, function reference and pointer to member types.
  • GIL: Generic Image Library
  • TTI: Type Traits Introspection library.
  • QVM: Boost QVM is a generic library for working with quaternions, vectors and matrices of static size with the emphasis on 2, 3 and 4-dimensional operations needed in graphics, video games and simulation applications.

Template Metaprogramming

  • Type Traits: Templates for fundamental properties of types.
  • Static Assert: Static assertions (compile time assertions).
  • MPL: The Boost.MPL library is a general-purpose, high-level C++ template metaprogramming framework of compile-time algorithms, sequences and metafunctions. It provides a conceptual foundation and an extensive set of powerful and coherent tools that make doing explict metaprogramming in C++ as easy and enjoyable as possible within the current language.
  • Function Types: Boost.FunctionTypes provides functionality to classify, decompose and synthesize function, function pointer, function reference and pointer to member types.
  • Fusion: Library for working with tuples, including various containers, algorithms, etc.
  • Proto: Expression template library and compiler construction toolkit for domain-specific embedded languages.
  • TTI: Type Traits Introspection library.
  • Metaparse: A library for generating compile time parsers parsing embedded DSL code as part of the C++ compilation process
  • Hana: A modern C++ metaprogramming library. It provides high level algorithms to manipulate heterogeneous sequences, allows writing type-level computations with a natural syntax, provides tools to introspect user-defined types and much more.
  • Mp11: A C++11 metaprogramming library.
  • CallableTraits: A spiritual successor to Boost.FunctionTypes, Boost.CallableTraits is a header-only C++11 library for the compile-time inspection and manipulation of all 'callable' types. Additional support for C++17 features.
  • HOF: Higher-order functions for C++

Preprocessor Metaprogramming

  • Preprocessor: Preprocessor metaprogramming tools including repetition and recursion.
  • Identity Type: Wrap types within round parenthesis so they can always be passed as macro parameters.
  • VMD: Variadic Macro Data library.

Concurrent Programming

  • Thread: Portable C++ multi-threading. C++11, C++14.
  • Asio: Portable networking and other low-level I/O, including sockets, timers, hostname resolution, socket iostreams, serial ports, file descriptors and Windows HANDLEs.
  • MPI: Message Passing Interface library, for use in distributed-memory parallel application programming.
  • Interprocess: Shared memory, memory mapped files, process-shared mutexes, condition variables, containers and allocators.
  • Context: (C++11) Context switching library.
  • Lockfree: Lockfree data structures.
  • Coroutine (deprecated): Coroutine library.
  • Atomic: C++11-style atomic<>.
  • Coroutine2: (C++11) Coroutine library.
  • Compute: Parallel/GPU-computing library
  • Fiber: (C++11) Userland threads library.
  • Beast: Portable HTTP, WebSocket, and network operations using only C++11 and Boost.Asio

Math and numerics

  • Integer: The organization of boost integer headers and classes is designed to take advantage of <stdint.h> types from the 1999 C standard without resorting to undefined behavior in terms of the 1998 C++ standard. The header <boost/cstdint.hpp> makes the standard integer types safely available in namespace boost without placing any names in namespace std.
  • Operators: Templates ease arithmetic classes and iterators.
  • Rational: A rational number class.
  • Random: A complete system for random number generation.
  • Math Octonion: Octonions.
  • Math: Boost.Math includes several contributions in the domain of mathematics: The Greatest Common Divisor and Least Common Multiple library provides run-time and compile-time evaluation of the greatest common divisor (GCD) or least common multiple (LCM) of two integers. The Special Functions library currently provides eight templated special functions, in namespace boost. The Complex Number Inverse Trigonometric Functions are the inverses of trigonometric functions currently present in the C++ standard. Quaternions are a relative of complex numbers often used to parameterise rotations in three dimentional space. Octonions, like quaternions, are a relative of complex numbers.
  • Math Quaternion: Quaternions.
  • Math Common Factor: Greatest common divisor and least common multiple.
  • uBLAS: uBLAS provides matrix and vector classes as well as basic linear algebra routines. Several dense, packed and sparse storage schemes are supported.
  • Multi-Array: Boost.MultiArray provides a generic N-dimensional array concept definition and common implementations of that interface.
  • Interval: Extends the usual arithmetic functions to mathematical intervals.
  • Numeric Conversion: Optimized Policy-based Numeric Conversions.
  • Math/Special Functions: A wide selection of mathematical special functions.
  • Math/Statistical Distributions: A wide selection of univariate statistical distributions and functions that operate on them.
  • Accumulators: Framework for incremental calculation, and collection of statistical accumulators.
  • Polygon: Voronoi diagram construction and booleans/clipping, resizing/offsetting and more for planar polygons with integral coordinates.
  • Ratio: Compile time rational arithmetic. C++11.
  • Geometry: The Boost.Geometry library provides geometric algorithms, primitives and spatial index.
  • Multiprecision: Extended precision arithmetic types for floating point, integer andrational arithmetic.
  • Odeint: Solving ordinary differential equations.
  • Endian: Types and conversion functions for correct byte ordering and more regardless of processor endianness.
  • QVM: Boost QVM is a generic library for working with quaternions, vectors and matrices of static size with the emphasis on 2, 3 and 4-dimensional operations needed in graphics, video games and simulation applications.

Correctness and testing

  • Concept Check: Tools for generic programming.
  • Static Assert: Static assertions (compile time assertions).
  • Test: Support for simple program testing, full unit testing, and for program execution monitoring.
  • Assert: Customizable assert macros.
  • Stacktrace: Gather, store, copy and print backtraces.
  • Contract: Contract programming for C++. All contract programming features are supported: Subcontracting, class invariants, postconditions (with old and return values), preconditions, customizable actions on assertion failure (e.g., terminate or throw), optional compilation and checking of assertions, etc.

Data structures

  • Compressed Pair: Empty member optimization.
  • Any: Safe, generic container for single values of different value types.
  • Tuple: Ease definition of functions returning multiple values, and more.
  • Optional: A value-semantic, type-safe wrapper for representing 'optional' (or 'nullable') objects of a given type. An optional object may or may not contain a value of the underlying type.
  • Variant: Safe, generic, stack-based discriminated union container.
  • Multi-Index: The Boost Multi-index Containers Library provides a class template named multi_index_container which enables the construction of containers maintaining one or more indices with different sorting and access semantics.
  • Pointer Container: Containers for storing heap-allocated polymorphic objects to ease OO-programming.
  • Bimap: Bidirectional maps library for C++. With Boost.Bimap you can create associative containers in which both types can be used as key.
  • Fusion: Library for working with tuples, including various containers, algorithms, etc.
  • Property Tree: A tree data structure especially suited to storing configuration data.
  • Uuid: A universally unique identifier.
  • Polygon: Voronoi diagram construction and booleans/clipping, resizing/offsetting and more for planar polygons with integral coordinates.
  • ICL: Interval Container Library, interval sets and maps and aggregation of associated values
  • Geometry: The Boost.Geometry library provides geometric algorithms, primitives and spatial index.
  • Container: Standard library containers and extensions.
  • Heap: Priority queue data structures.
  • Type Erasure: Runtime polymorphism based on concepts.

Domain Specific

  • CRC: The Boost CRC Library provides two implementations of CRC (cyclic redundancy code) computation objects and two implementations of CRC computation functions. The implementations are template-based.
  • Date Time: A set of date-time libraries based on generic programming concepts.
  • Units: Zero-overhead dimensional analysis and unit/quantity manipulation and conversion.
  • Uuid: A universally unique identifier.
  • Chrono: Useful time utilities. C++11.

Image processing

  • GIL: Generic Image Library

Input/Output

  • IO State Savers: The I/O sub-library of Boost helps segregate the large number of Boost headers. This sub-library should contain various items to use with/for the standard I/O library.
  • Format: The format library provides a type-safe mechanism for formatting arguments according to a printf-like format-string.
  • Serialization: Serialization for persistence and marshalling.
  • Assign: Filling containers with constant or generated data has never been easier.
  • Program Options: The program_options library allows program developers to obtain program options, that is (name, value) pairs from the user, via conventional methods such as command line and config file.
  • Iostreams: Boost.IOStreams provides a framework for defining streams, stream buffers and i/o filters.
  • Asio: Portable networking and other low-level I/O, including sockets, timers, hostname resolution, socket iostreams, serial ports, file descriptors and Windows HANDLEs.
  • Endian: Types and conversion functions for correct byte ordering and more regardless of processor endianness.
  • Beast: Portable HTTP, WebSocket, and network operations using only C++11 and Boost.Asio

Inter-language support

  • Python: The Boost Python Library is a framework for interfacing Python and C++. It allows you to quickly and seamlessly expose C++ classes functions and objects to Python, and vice-versa, using no special tools -- just your C++ compiler.

Language Features Emulation

  • Parameter: Boost.Parameter Library - Write functions that accept arguments by name.
  • Foreach: In C++, writing a loop that iterates over a sequence is tedious. We can either use iterators, which requires a considerable amount of boiler-plate, or we can use the std::for_each() algorithm and move our loop body into a predicate, which requires no less boiler-plate and forces us to move our logic far from where it will be used. In contrast, some other languages, like Perl, provide a dedicated "foreach" construct that automates this process. BOOST_FOREACH is just such a construct for C++. It iterates over sequences for us, freeing us from having to deal directly with iterators or write predicates.
  • Typeof: Typeof operator emulation.
  • Exception: The Boost Exception library supports transporting of arbitrary data in exception objects, and transporting of exceptions between threads.
  • Scope Exit: Execute arbitrary code at scope exit.
  • Move: Portable move semantics for C++03 and C++11 compilers.
  • Type Index: Runtime/Compile time copyable type info.

Memory

  • Utility: Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom.
  • Pool: Memory pool management.
  • Smart Ptr: Smart pointer class templates.
  • Align: Memory alignment functions, allocators, and traits.

Parsing

  • Spirit: LL parser framework represents parsers directly as EBNF grammars in inlined C++.

Patterns and Idioms

  • Compressed Pair: Empty member optimization.
  • Utility: Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom.
  • Signals (deprecated): Managed signals & slots callback implementation.
  • Flyweight: Design pattern to manage large quantities of highly redundant objects.
  • Signals2: Managed signals & slots callback implementation (thread-safe version 2).

Programming Interfaces

  • Function: Function object wrappers for deferred calls or callbacks.
  • Parameter: Boost.Parameter Library - Write functions that accept arguments by name.

State Machines

  • Statechart: Boost.Statechart - Arbitrarily complex finite state machines can be implemented in easily readable and maintainable C++ code.
  • Meta State Machine: A very high-performance library for expressive UML2 finite state machines.

System

  • Thread: Portable C++ multi-threading. C++11, C++14.
  • Date Time: A set of date-time libraries based on generic programming concepts.
  • Filesystem: The Boost Filesystem Library provides portable facilities to query and manipulate paths, files, and directories.
  • System: Operating system support, including the diagnostics support that will be part of the C++0x standard library.
  • Chrono: Useful time utilities. C++11.
  • Context: (C++11) Context switching library.
  • DLL: Library for comfortable work with DLL and DSO.
  • Fiber: (C++11) Userland threads library.
  • Process: Library to create processes in a portable way.
  • Stacktrace: Gather, store, copy and print backtraces.

Miscellaneous

  • Timer: Event timer, progress timer, and progress display classes.
  • Value Initialized: Wrapper for uniform-syntax value initialization, based on the original idea of David Abrahams.
  • Utility: Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom.
  • Conversion: Polymorphic casts.
  • Lexical Cast: General literal text conversions, such as an int represented a string, or vice-versa.
  • Tribool: 3-state boolean type library.
  • Program Options: The program_options library allows program developers to obtain program options, that is (name, value) pairs from the user, via conventional methods such as command line and config file.
  • Numeric Conversion: Optimized Policy-based Numeric Conversions.
  • Swap: Enhanced generic swap function.
  • Log: Logging library.
  • Predef: This library defines a set of compiler, architecture, operating system, library, and other version numbers from the information it can gather of C, C++, Objective C, and Objective C++ predefined macros or those defined in generally available headers.
  • Core: A collection of simple core utilities with minimal dependencies.
  • ThrowException: A common infrastructure for throwing exceptions from Boost libraries.
  • Endian: Types and conversion functions for correct byte ordering and more regardless of processor endianness.
  • Convert: An extendible and configurable type-conversion framework.

Broken compiler workarounds

  • Config: Helps Boost library developers adapt to compiler idiosyncrasies; not intended for library users.
  • Compatibility: Help for non-conforming standard libraries.