The library defines a set of containers that have been specially tailored for embedded systems.
They have a maximum capacity fixed at compile time and make no calls to malloc/free or new/delete.
They are completely deterministic.
Most container types have been designed to mimic, as far as possible, those found in the STL. Some do not have direct
As the storage for all of the container types is allocated as a contiguous block, they are extremely cache friendly.
Note: In the ETL vector<bool> really is a container and actually does contains bool.
There are intrusive versions of certain containers. These do not store copies of the inserted values, but link to the
original objects. Certain types of intrusive container require that the stored object derives from an intrusive link.
Most intrusive containers do not have a maximum fixed capacity.
See here for more information.
unordered_map & unordered_multimap
unordered_set & unordered_multiset
To eliminate code bloat, most container templates utilise 'hoisting' where functionality, independent of the size and/or
type, is separated out in to base classes.
For example, vector<int, 5> and vector<int, 10> will share code from ivector<int>.
vector<int, 5>, vector<float, 7> and vector<int, 10> will all share code from vector_base.
The 'i' prefixed container types may be used as size independent pointer or reference types for all sizes of the derived
etl::vector<int, 5> vector1;
etl::vector<int, 10> vector2;
pvector = &vector1;
pvector = &vector2;
Differences from the STL containers
As the containers have a fixed capacity, most also implement full() and available() member functions.
Any member functions that require rvalue references are not supported.
For maximal efficiency, the method of passing values is dependent on the type. Fundamental types and pointers are
passed by value; other types by const reference. The method for a particular instance is automatically selected at
The method for implementing this can be found here.
Most of the containers allocate their storage from an internal instance of etl::pool.
Because of this the containers have a certain set of attributes that differ from the standard library.
• The storage for all containers is contiguous, thereby enhancing cache hits.
• No heap memory is used; no OS supplied memory management is required.
• Non-static containers declared locally within functions will store their contents on the stack.
• Copying or swapping a container is not a low cost action, as all of the contents will be copied.
Although the containers utilise inheritance, like the STL containers they are not intended to be used polymorphically.
ETL containers are not virtual.
Add other non-STL containers:-
Splay tree (etl::splay_map, etl::splay_set etc).
More intrusive containers.
Cache containers (Least Recently Used, Most Recently Used, Random Release)
Add specialisations for pointer types.
Where the pointers are implemented by a void* base implementation. (Done for vector)
Add UTF8 string class.