A header-only C++11/20 library providing specialized containers like static_vector, small_vector, and flat_map for performance and embedded use.
sfl is a header-only C++ library that provides a wide array of specialized container types beyond the standard library, such as static_vector, small_vector, flat_map, and their associative variants. It solves problems related to dynamic memory overhead, performance in embedded systems, and the need for containers usable in compile-time contexts. The library emphasizes compatibility with older C++ compilers while supporting modern features like constant expressions.
C++ developers working on performance-sensitive applications, embedded systems, game engines, or any project requiring fine-tuned memory management and container performance. It is also suitable for developers needing containers that work in C++20 constant expressions or with legacy toolchains.
Developers choose sfl for its extensive container options that address specific performance and memory use cases, its support for constant expressions, and its compatibility with very old compilers. It offers a lightweight, header-only alternative to rolling custom containers or dealing with the limitations of std containers in constrained environments.
C++11/20 library that provides static_vector, small_vector, static_map, small_map, flat_map, static_flat_map, small_flat_map, static_unordered_map, small_unordered_map, etc.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Explicitly tested with GCC 4.8.5 and Clang 3.4.2, enabling use in older or constrained toolchains where modern C++ standards aren't available.
Most containers (except small_* variants) are usable in C++20 constant expressions, allowing compile-time container operations for metaprogramming or embedded initialization.
Provides static containers (e.g., static_vector) with no dynamic memory, and small buffer optimization containers to avoid heap allocations for small element counts.
Includes devector for fast front/back operations and segmented_vector for reallocation-free growth, addressing specific performance gaps in std::vector.
Easy integration via manual copy-paste or CMake FetchContent, reducing build system complexity compared to compiled libraries.
small_* containers cannot be used in constant expressions, creating a inconsistency and limiting compile-time usage for these memory-optimized types.
Constant expression usage has compiler bugs, like MSVC requiring empty functors for unordered containers, which can trip up developers and reduce portability.
Documentation is manually written in Markdown and admits potential errors, lacking the reliability of auto-generated tools like Doxygen for API references.
The plethora of similar containers (e.g., 4+ map types) can lead to analysis paralysis and a steeper learning curve for choosing the right one.