[](https://github.com/espressif/esp-boost/actions/workflows/pre-commit.yml) [](https://components.espressif.com/components/espressif/esp-boost)
# ESP Boost C++ Library
* [中文版](./README_CN.md)
## Overview
esp-boost is a C++ library ported by Espressif based on [Boost](https://github.com/boostorg/boost), designed for developing C++ applications on ESP series SoCs (ESP32, ESP32-S3, ESP32-P4, etc.).
> [!NOTE]
> - esp-boost is ported from the official Boost library version `1.87.0`.
> - Most libraries in esp-boost are directly copied from the official repository. Due to platform dependencies in some libraries, we made necessary modifications to compile on ESP-IDF (such as adding [esp32.hpp](src/boost/config/platform/esp32.hpp) and [esp32.cpp](src/boost/config/src/esp32.cpp) in the `config` directory). All modifications are marked with `esp32` comments.
> [!WARNING]
> - esp-boost has not yet fully ported all libraries from Boost, only a subset of commonly used functionalities. For specific support information, please refer to [Supported Libraries](#supported-libraries).
> - Since many Boost libraries require C++ `Exception` and `RTTI` features, which are disabled by default in ESP-IDF, users need to enable the `CONFIG_COMPILER_CXX_EXCEPTIONS` and `CONFIG_COMPILER_CXX_RTTI` configuration options in `menuconfig`.
## Table of Contents
- [ESP Boost C++ Library](#esp-boost-c-library)
- [Overview](#overview)
- [Table of Contents](#table-of-contents)
- [How to Use](#how-to-use)
- [SDK \& Dependencies](#sdk--dependencies)
- [Adding to Project](#adding-to-project)
- [Supported Libraries](#supported-libraries)
## How to Use
### SDK & Dependencies
Before using this library, please ensure you have installed the SDK that meets the following version requirements:
| **SDK** | **Version Required** |
| ----------------------------------------------- | -------------------- |
| [esp-idf](https://github.com/espressif/esp-idf) | >= 5.3 |
> [!NOTE]
> * For SDK installation, please refer to [ESP-IDF Programming Guide - Installation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#get-started-how-to-get-esp-idf)
### Adding to Project
esp-boost has been uploaded to the [Espressif Component Registry](https://components.espressif.com/). You can add it to your project in the following ways:
1. **Using Command Line**
Run the following command in your project directory:
```bash
idf.py add-dependency "espressif/esp-boost"
```
2. **Modifying Configuration File**
Create or modify the *idf_component.yml* file in your project directory:
```yaml
dependencies:
espressif/esp-boost: "*"
```
For detailed information, please refer to [Espressif Documentation - IDF Component Manager](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html).
## Supported Libraries
📋 Below is a list of libraries supported by esp-boost:
> [!NOTE]
> In the table below, the icons and symbols have the following meanings:
> - ✅: Indicates that the library has been fully ported and has been completely validated using official examples and tests.
> - ⚠️: Indicates that the library's source code has been ported, but has not been fully validated with tests.
> - ❌: Indicates that there are no relevant examples or tests.
| **Name** | **Status** | **Documentation** | **Examples** | **Tests** |
| --------------- | ---------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| signals2 | ✅️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/signals2/index.html) | [Internal](./test_apps/signals2/example/) / [Official](https://github.com/boostorg/signals2/tree/boost-1.87.0/example) | [Internal](./test_apps/signals2/test/) / [Official](https://github.com/boostorg/signals2/tree/boost-1.87.0/test) |
| thread | ✅️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/thread/index.html) | [Internal](./test_apps/thread/example/) / [Official](https://github.com/boostorg/thread/tree/boost-1.87.0/example) | [Internal 1](./test_apps/thread/test_common/) & [Internal 2](./test_apps/thread/test_more/) / [Official](https://github.com/boostorg/thread/tree/boost-1.87.0/test) |
| algorithm | ✅️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/algorithm/index.html) | [Internal](./test_apps/algorithm/example/) / [Official](https://github.com/boostorg/algorithm/tree/boost-1.87.0/example) | [Internal](./test_apps/algorithm/test/) / [Official](https://github.com/boostorg/algorithm/tree/boost-1.87.0/test) |
| align | ✅️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/align/index.html) | ❌ | [Internal](./test_apps/align/test/) / [Official](https://github.com/boostorg/align/tree/boost-1.87.0/test) |
| array | ✅️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/array/index.html) | ❌ | [Internal](./test_apps/array/test/) / [Official](https://github.com/boostorg/array/tree/boost-1.87.0/test) |
| format | ✅️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/format/doc/format.html) | [Internal](./test_apps/format/example/) / [Official](https://github.com/boostorg/format/tree/boost-1.87.0/example) | [Internal](./test_apps/format/test/) / [Official](https://github.com/boostorg/format/tree/boost-1.87.0/test) |
| graph | ✅️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/graph/index.html) | [Internal](./test_apps/graph/example/) / [Official](https://github.com/boostorg/graph/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/graph/tree/boost-1.87.0/test) |
| asio | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/asio/index.html) | [Official](https://github.com/boostorg/asio/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/asio/tree/boost-1.87.0/test) |
| assert | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/assert/index.html) | ❌ | [Official](https://github.com/boostorg/assert/tree/boost-1.87.0/test) |
| atomic | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/atomic/index.html) | ❌ | [Official](https://github.com/boostorg/atomic/tree/boost-1.87.0/test) |
| bimap | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/bimap/index.html) | [Official](https://github.com/boostorg/bimap/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/bimap/tree/boost-1.87.0/test) |
| bind | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/bind/index.html) | ❌ | [Official](https://github.com/boostorg/bind/tree/boost-1.87.0/test) |
| chrono | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/chrono/index.html) | [Official](https://github.com/boostorg/chrono/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/chrono/tree/boost-1.87.0/test) |
| config | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/config/index.html) | ❌ | [Official](https://github.com/boostorg/config/tree/boost-1.87.0/test) |
| concept_check | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/concept_check/index.html) | ❌ | [Official](https://github.com/boostorg/concept_check/tree/boost-1.87.0/test) |
| container | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/container/index.html) | [Official](https://github.com/boostorg/container/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/container/tree/boost-1.87.0/test) |
| container_hash | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/container_hash/index.html) | ❌ | [Official](https://github.com/boostorg/container_hash/tree/boost-1.87.0/test) |
| conversion | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/conversion/index.html) | ❌ | [Official](https://github.com/boostorg/conversion/tree/boost-1.87.0/test) |
| core | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/core/index.html) | ❌ | [Official](https://github.com/boostorg/core/tree/boost-1.87.0/test) |
| date_time | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/date_time/index.html) | [Official](https://github.com/boostorg/date_time/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/date_time/tree/boost-1.87.0/test) |
| describe | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/describe/index.html) | [Official](https://github.com/boostorg/describe/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/describe/tree/boost-1.87.0/test) |
| detail | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/detail/index.html) | ❌ | [Official](https://github.com/boostorg/detail/tree/boost-1.87.0/test) |
| dynamic_bitset | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/dynamic_bitset/index.html) | [Official](https://github.com/boostorg/dynamic_bitset/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/dynamic_bitset/tree/boost-1.87.0/test) |
| endian | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/endian/index.html) | [Official](https://github.com/boostorg/endian/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/endian/tree/boost-1.87.0/test) |
| exception | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/exception/index.html) | [Official](https://github.com/boostorg/exception/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/exception/tree/boost-1.87.0/test) |
| foreach | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/foreach/index.html) | ❌ | [Official](https://github.com/boostorg/foreach/tree/boost-1.87.0/test) |
| function | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/function/index.html) | [Official](https://github.com/boostorg/function/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/function/tree/boost-1.87.0/test) |
| function_types | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/function_types/index.html) | [Official](https://github.com/boostorg/function_types/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/function_types/tree/boost-1.87.0/test) |
| fusion | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/fusion/index.html) | [Official](https://github.com/boostorg/fusion/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/fusion/tree/boost-1.87.0/test) |
| io | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/io/index.html) | ❌ | [Official](https://github.com/boostorg/io/tree/boost-1.87.0/test) |
| integer | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/integer/index.html) | ❌ | [Official](https://github.com/boostorg/integer/tree/boost-1.87.0/test) |
| intrusive | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/intrusive/index.html) | [Official](https://github.com/boostorg/intrusive/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/intrusive/tree/boost-1.87.0/test) |
| iterator | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/iterator/index.html) | [Official](https://github.com/boostorg/iterator/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/iterator/tree/boost-1.87.0/test) |
| json | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/json/index.html) | [Official](https://github.com/boostorg/json/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/json/tree/boost-1.87.0/test) |
| lexical_cast | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/lexical_cast/index.html) | [Official](https://github.com/boostorg/lexical_cast/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/lexical_cast/tree/boost-1.87.0/test) |
| math | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/math/index.html) | [Official](https://github.com/boostorg/math/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/math/tree/boost-1.87.0/test) |
| move | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/move/index.html) | [Official](https://github.com/boostorg/move/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/move/tree/boost-1.87.0/test) |
| mp11 | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/mp11/index.html) | ❌ | [Official](https://github.com/boostorg/mp11/tree/boost-1.87.0/test) |
| mpl | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/mpl/index.html) | [Official](https://github.com/boostorg/mpl/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/mpl/tree/boost-1.87.0/test) |
| multi_index | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/multi_index/index.html) | [Official](https://github.com/boostorg/multi_index/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/multi_index/tree/boost-1.87.0/test) |
| optional | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/optional/index.html) | ❌ | [Official](https://github.com/boostorg/optional/tree/boost-1.87.0/test) |
| parameter | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/parameter/index.html) | ❌ | [Official](https://github.com/boostorg/parameter/tree/boost-1.87.0/test) |
| phoenix | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/phoenix/index.html) | [Official](https://github.com/boostorg/phoenix/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/phoenix/tree/boost-1.87.0/test) |
| pool | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/pool/index.html) | [Official](https://github.com/boostorg/pool/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/pool/tree/boost-1.87.0/test) |
| predef | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/predef/index.html) | ❌ | [Official](https://github.com/boostorg/predef/tree/boost-1.87.0/test) |
| preprocessor | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/preprocessor/index.html) | ❌ | [Official](https://github.com/boostorg/preprocessor/tree/boost-1.87.0/test) |
| property_map | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/property_map/index.html) | [Official](https://github.com/boostorg/property_map/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/property_map/tree/boost-1.87.0/test) |
| property_tree | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/property_tree/index.html) | [Official](https://github.com/boostorg/property_tree/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/property_tree/tree/boost-1.87.0/test) |
| proto | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/proto/index.html) | [Official](https://github.com/boostorg/proto/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/proto/tree/boost-1.87.0/test) |
| random | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/random/index.html) | [Official](https://github.com/boostorg/random/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/random/tree/boost-1.87.0/test) |
| range | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/range/index.html) | ❌ | [Official](https://github.com/boostorg/range/tree/boost-1.87.0/test) |
| ratio | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/ratio/index.html) | [Official](https://github.com/boostorg/ratio/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/ratio/tree/boost-1.87.0/test) |
| regex | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/regex/index.html) | [Official](https://github.com/boostorg/regex/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/regex/tree/boost-1.87.0/test) |
| serialization | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/serialization/index.html) | [Official](https://github.com/boostorg/serialization/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/serialization/tree/boost-1.87.0/test) |
| smart_ptr | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/smart_ptr/index.html) | [Official](https://github.com/boostorg/smart_ptr/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/smart_ptr/tree/boost-1.87.0/test) |
| spirit | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/spirit/index.html) | [Official](https://github.com/boostorg/spirit/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/spirit/tree/boost-1.87.0/test) |
| static_assert | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/static_assert/index.html) | [Official](https://github.com/boostorg/static_assert/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/static_assert/tree/boost-1.87.0/test) |
| system | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/system/index.html) | ❌ | [Official](https://github.com/boostorg/system/tree/boost-1.87.0/test) |
| test | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/test/index.html) | [Official](https://github.com/boostorg/test/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/test/tree/boost-1.87.0/test) |
| throw_exception | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/throw_exception/index.html) | ❌ | [Official](https://github.com/boostorg/throw_exception/tree/boost-1.87.0/test) |
| tokenizer | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/tokenizer/index.html) | [Official](https://github.com/boostorg/tokenizer/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/tokenizer/tree/boost-1.87.0/test) |
| tti | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/tti/index.html) | ❌ | [Official](https://github.com/boostorg/tti/tree/boost-1.87.0/test) |
| tuple | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/tuple/index.html) | ❌ | [Official](https://github.com/boostorg/tuple/tree/boost-1.87.0/test) |
| type_traits | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/type_traits/index.html) | ❌ | [Official](https://github.com/boostorg/type_traits/tree/boost-1.87.0/test) |
| typeof | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/typeof/index.html) | ❌ | [Official](https://github.com/boostorg/typeof/tree/boost-1.87.0/test) |
| unordered | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/unordered/index.html) | [Official](https://github.com/boostorg/unordered/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/unordered/tree/boost-1.87.0/test) |
| utility | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/utility/index.html) | ❌ | [Official](https://github.com/boostorg/utility/tree/boost-1.87.0/test) |
| variant | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/variant/index.html) | ❌ | [Official](https://github.com/boostorg/variant/tree/boost-1.87.0/test) |
| variant2 | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/variant2/index.html) | ❌ | [Official](https://github.com/boostorg/variant2/tree/boost-1.87.0/test) |
| winapi | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/winapi/index.html) | ❌ | [Official](https://github.com/boostorg/winapi/tree/boost-1.87.0/test) |
| xpressive | ⚠️ | [Link](https://www.boost.org/doc/libs/1_87_0/libs/xpressive/index.html) | [Official](https://github.com/boostorg/xpressive/tree/boost-1.87.0/example) | [Official](https://github.com/boostorg/xpressive/tree/boost-1.87.0/test) |
8c18ef17580e00c1c440a516b1c7511475dbecd9
idf.py add-dependency "espressif/esp-boost^0.4.1"