A C++ template library for embedded applications logo

A C++ template library for embedded applications

Free

C++ Embedded Template Library for deterministic, resource-constrained systems.

FreeFree tier
Type
Open Source

About A C++ template library for embedded applications

The Embedded Template Library (ETL) is a C++ template library specifically designed for embedded systems development. It provides a set of containers with fixed or maximum sizes defined at compile-time, avoiding dynamic memory allocation entirely. The library offers APIs closely resembling the C++ Standard Template Library (STL) for familiarity, while being compatible with C++98 and implementing features from later standards (C++11/14/17/20/23/26) where possible. ETL guarantees deterministic behavior, making it ideal for real-time and resource-constrained environments. It includes additional components and utilities useful in embedded contexts that are absent from the STL. The library requires no heap usage and is compatible with any compiler supporting C++03 or later.

Key Features

Fixed-size containers defined at compile-time
No dynamic memory allocation (heap never used)
STL-like API for ease of use and familiarity
Compatible with C++98 through C++26
Deterministic behavior critical for real-time systems
Includes additional embedded-specific utilities not in the STL

Pros & Cons

Pros
  • Ideal for lower-resource embedded applications with strict memory constraints
  • Deterministic behavior ensures predictable execution timing
  • Memory requirements fully known at compile time
  • Backports modern C++ features for older compilers lacking full standards support
  • No heap allocation eliminates fragmentation and allocation failures
Cons
  • Not a full STL replacement; some STL features may be missing or differently implemented
  • Requires manual definition of container capacities (fixed size) which may increase design effort
  • Learning curve for developers accustomed to dynamically resizable containers
  • Limited to C++ projects; not applicable to other programming languages

Best For

Embedded systems developmentReal-time applications requiring deterministic performanceResource-constrained environments (e.g., IoT devices, microcontrollers)Projects where dynamic memory allocation is prohibitedBackporting modern C++ features to legacy embedded toolchains

FAQ

Why not use the standard STL for embedded systems?
The STL often relies on dynamic memory allocation, which is unsuitable for environments with strict deterministic behavior and limited resources. ETL avoids heap usage entirely and provides fixed-size containers that allow memory requirements to be determined at compile-time, making it ideal for embedded and real-time applications.
What compilers and C++ standards does the ETL support?
The ETL is compatible with any compiler that supports C++03 or later. It implements features from C++11/14/17/20/23/26 where possible, even on older compilers, making it useful for toolchains with limited modern C++ support.