A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd
MIT licensed
Join the ETL community
Additions and fixes
Monday, May 27, 2019
Simplified message framework internal code.
receive() virtual function overload taking destination id.
is_bus() member function.

Added variadic template versions of
etl::largest, etl::largest_type,
etl::largest_alignment and etl::smallest

Fixed bug in 'vector of pointers' move constructor.

etl::delegate and etl::delegate_service.

Added an optional secure mode to strings so that unused space will be cleared to zero
and also cleared on destruction.

Modified memory functions so that they will not be optimised away.

etl::memory_clear and etl::memory_set utility functions.
These functions will overwrite the memory allocated to the supplied object.

Added variadic min and max functions.
C++11 only.
to_string + small additions & fixes
Friday, April 19, 2019
Added to_string to format bools, integrals, floating point and pointers to strings.

emplace member functions to etl::optional.

Fixed etl::cyclic_value rollover with negative advance.
C++11 variadic templates for observer pattern
Saturday, March 30, 2019
C++11 variadic templates for observer pattern class etl::observer
C++11 variadic templates for visitor pattern
Saturday, March 30, 2019
C++11 variadic templates for visitor pattern classes etl::visitable and etl::visitor
External buffer support for vector
Saturday, March 30, 2019
Added external buffer support for etl::vector
Bug fixes and new features
Saturday, March 23, 2019
Improved the 'truncate' flag in strings to better indicate the truncation state after modification.
Added assignment from zero terminated string pointer.
Fixed string
push_back() bug where ther internal terminator was not updated.
Added const ref istring constructors.

Basic Conan package added.

Updated profiles for C++17.

etl::queue_spsc_locked with injected locking functions.

Enabled emplace functions for 'No STL'.

Moved C++03 force macros to test profile.

Fix inconsistent
ETL_FILE definitions.

Fix 'force C++03' macros leftover from testing.

Added rvalue reference interfaces to

Fix for
unordered_map, unordered_multimap, unordered_set and unordered_multiset insert and erase bug.


std::forward support to alternate STL utility header.

Added constexpr constructors to
string_view and array_view.

Added missing
#include "stl/interator.h" in frame_check_sequence.h

Fixed bug for certain inserts in
etl::callback_service + fixes
Monday, February 04, 2019
Added etl::callback_service
Useful for abstracting the interrupt system from C++ handlers.

#include <new> to message_router.h for improved cross platform compatibility.

Rvalue reference C++-03/C++11 compatibility fix.

Added rvalue reference APIs and flat_map fix
Saturday, January 05, 2019
Added rvalue reference APIs to etl::deque, etl::list and etl::vector
Fix to etl::flat_map operator [] and insert.
Scaled rounding and moving average
Friday, December 28, 2018
Added etl::scaled_rounding to allow selection of rounding algorithms when emulating fixed point arithmetic with scaled integral values.

etl::cumulative_moving_average, implementing an algorithm for calculating an average for a stream of samples. There are specialisations for floating point and scaled integral sample types.

Added C++11 rvalue reference push functions for etl::deque.
Sunday, December 09, 2018
Added C++03/C++11 emplace for deque, priority_queue, queues, stack, variant & vector.
Hash based RNG, shared pools for forward_list
Saturday, December 08, 2018
Added etl::random_hash which generates pseudo-random numbers based on a counter and user supplied hash.
etl::forward_list supports shared pools.
All header library
Sunday, November 11, 2018
Version 14.0.0
Breaking change!
The ETL library is now 'all header'.
All references to ETL's cpp files will need to be removed from your project.

Bit stream serialiser/deserialiser
Saturday, October 06, 2018
Added bit stream serialiser/deserialiser.
Added host-to-network and network-to-host conversion functions.

Changed etl::state_chart constructor API
Saturday, September 15, 2018
Modified the etl:state_chart constructor API to accept ranges instead of etl::array.
Remove redundant member functions
Saturday, September 15, 2018
Removed push(void), push_back(void) and push_front(void) function for containers.
New state chart template
Friday, August 24, 2018
Added etl::state_chart
etl::state_chart is a low weight finite state machine.
It is less complex than
etl::fsm and may be used when the full facilities of a message passing state machine are not required.
Minor fixes
Thursday, August 09, 2018
io_port_test Fixed unaligned access error.
debug_count  Removed typed += & -= operators and replaced with templates.
Various updates and fixes
Sunday, July 29, 2018
Added 'memory model' selection for queues to allow more efficient implementations.

Maximum queue sizes:
MEMORY_MODEL_SMALL  255 (254 for queue_spsc_atomic)
MEMORY_MODEL_HUGE   9223372036854775807

Fixed syntax errors highlighted by GCC v8
reference_flat_set & reference_flat_map reliance on equality.
flat_set & flat_map reliance on equality.
Added tests for limited support for self insert for strings.
wipe_on_destruct template class for secure wiping of objects on destruction.
unique_ptr API.
Protected destructor for some FSM classes.
remove_observer returns bool.
Fixed vector of pointer typedefs
Added specialisation for
vector<const T*>
Remove SFINAE from
Added default
etl::less compare type appropriate map and set classes.
Moved non-template code in
pvoidvector to cpp file.
Made atomic load const for non STL versions
Removed non-conforming
Various updates
Monday, June 18, 2018
Segger IDE compatibility changes.
Added flag to call on_enter_state on start. Default true.
Non-virtual message destructor is no longer protected.
Remove non-conforming
New binary uitilities
Sunday, May 20, 2018
Added binary_merge, binary_interleave, is_odd, is_even.
Sunday, May 06, 2018
Added new CRC (Castagnoli)
Binary uitilities
Sunday, April 29, 2018
Added new binary utilities

Atomics, mutexes and queues
Sunday, April 08, 2018
Updated etl::atomic
Atomics, if the compiler has support for implementing them.

Added etl::mutex
Mutexes, if the compiler has support for implementing them.

Added etl::queue_spsc_isr
A queue for interrupt driven systems. Single Producer / Single Consumer

Added etl::queue_spsc_atomic
A queue for interrupt or threaded systems using atomics. Single Producer / Single Consumer

Added etl::queue_mpmc_mutex
A queue for interrupt or threaded systems using mutexes. Multi Producer / Multi Consumer
New directory layout
Sunday, March 18, 2018
Changed the directory layout to match the convention for most other libraries to allow easier handling of clashing file names.

Etl/src         .
c & .cpp

If the addition include path is set to etl/include/ then headers may be selected as follows:-
#include "etl/vector.h"

This breaks compatibility with the standard Arduino library directory layout specifications. Arduino users should use version 10.21.2

The new directory layout will start from version
Added version macros
Saturday, March 03, 2018
Added version macros.

Destructor changes for message framework
Friday, February 02, 2018
Added protected destuctor to etl::ifsm_state.

Added protected destuctor to

Added protected destructor to
etl::imessage if not polymorphic.

Modified destructor of nested
message_packet class to select destructor code based on whether etl::imessage is polymorphic or not.
Added generator for etl::variant_pool
Thursday, February 01, 2018
Added variant_pool_generator.h to allow generation of variant pool code for N types.
See Generators

Optional polymorphic containers
Thursday, February 01, 2018
Added code to allow selected containers to be deletable via their base class; i.e. Delete a vector via a pointer to ivector.
By default, containers are not polymorphic.

Define any of these to enable polymorphism for the relevent container type.

If all containers are required to be polymorphic then define ETL_POLYMORPHIC_CONTAINERS
Fast clear for trivially destructable elements
Sunday, January 28, 2018
so that clear() is a fast operation for trivially destructable elements. (for C++03 this only includes integral and pointr types.)
Array wapper, new XOR checksum, constexpr support.
Thursday, January 25, 2018
Added etl::array_wrapper to add a zero cost STL like interface to pre-declared C arrays.

Added etl::xor_rotate checksum algorithm.

Added definition of ETL_CONSTEXPR to support constexpr when available.

FSM tidy up and add array_view
Tuesday, December 26, 2017
Tidy up of FSM code; remove unnecessary helper class.

etl::array_view to encapsulate ranges of contiguous containers such as C arrays, etl::array, std::array, etl::vector and std::vector.

Changed all instances of alignof() to etl::alignment_of<>.
factory/variant_pool, binary
Monday, December 18, 2017
Deprecated etl::factory; Added etl::variant_pool in as its replacement.
Added sign extend functions with shift parameter.

Moved some binary functions from templates in header to normal functions in cpp file.

clear() to debug_count.

type_lookup code.
Message router, io_port changes and type traits
Thursday, November 30, 2017
Message Routers
The message router framework has been updated to allow a 'successor' to be specified. If a successor is set then a message that is not handled by the current router will be passed on. This addition allows the message router to implement the Chain Of Responsibilty design pattern.

IO Ports
The nested iterator classes have been removed from all but the runtime address
io_port_wos. The classes are now iterators themselves. This removed a level of indirection when iterating.

Type Traits
conditional_integral_constant. Chooses a value based on the supplied condition.
Clean compile for GCC warnings
Wednesday, November 01, 2017
Clean compile for GCC warnings

Created Slack group
Wednesday, November 01, 2017
I have created a Slack group to better support the ETL.
You can find it here.

Added helper functions to etl::imessage_router
Friday, October 27, 2017
Added is_null_router() and is_bus() to etl::imessage_router.
Added etl::generic_pool top level template class
Thursday, October 26, 2017
Added a top level template class, etl::generic_pool, inheriting from etl::ipool, that allows easier creation of generic fixed block pools.
Fixed FSM bug
Wednesday, October 25, 2017
Fixed issue in etl::fsm where on_exit_state was called after the state had changed.
C timer framework
Tuesday, October 24, 2017
A version of the etl::callback_timer framework has been created for C only projects. The API and underlying code are virtually the same as the C++ version.

The are two example Keil projects for the ST Nucleo-401RE development board.
C++ timer callbacks
C timer callbacks

Compilation results for the C and C++ callback frameworks are as follows. (-03)

     C (ARM5) : C (ARM6) : C++ (ARM5) : C++ (ARM6)
2748       2694        2564         2254
RO      456        530         460          458
RW       28          8          16            8
ZI     1716       1736        1736         1744
Timer triggered callbacks
Wednesday, October 18, 2017
>>> Breaking change <<<
Due to the complexities of trying to adapt to many different platforms, the way that the ETL is configured has changed. Previously, platform.h interrogated compiler built-in macros to determine what C++ features were supported. This has now been changed to a 'profile' system. platform.h calls a user defined header etl_profile.h which in turn includes a profile header which will define the ETL settings for the platform. There are several predefined profiles which may either be used 'as-is' or as the basis for a custom version. See here for details.

This update sees the introduction of timer triggered callback frameworks.
There are two versions, one invokes callbacks to global, static or member functions, the other integrates into the ETL's messaging framework.
Function callbacks
Message callbacks

As a consequence of adding the timer frameworks a certain amount of support for atomics has been added.
atomic.h will either include STL's <atomic>, if the compiler supports it (as indicated by the profile) or an ETL implementation. Currently there is an ETL implementation for pre C++11 GCC and ARMv5 compilers.
See Atomic

Factory and type lookup templates added
Monday, September 18, 2017
Added etl::factory<...>
This template is a type of container that will allow creation of up to N instances of a specified set of derived classes.
The difference to a normal container is that it is the responsibilty of the caller to destroy the returned instances.

Added etl::type_id_lookup<...> and etl::type_type_lookup<...>
These templates allow compile time mapping of id to type, type to id and type to type.
Type lookup
Extension to type_traits
Friday, August 25, 2017
Added a new template to type_traits.h
etl::types<typename T>

Allows retrieval of various types from the template parameter type.
typedef const int* const MyType;

etl::types<MyType>::type                int
etl::types<MyType>::reference           int&
etl::types<MyType>::const_reference     const int&
etl::types<MyType>::pointer             int*
etl::types<MyType>::const_pointer       const int*
etl::types<MyType>::const_pointer_const const int* const

Various changes
Thursday, August 17, 2017
Messages are now non-virtual by default. Define ETL_MESSAGES_ARE_VIRTUAL to make them virtual.
Added 'make_xxx' functions, that return references to the created object, to complement the current 'create_xxx' ones.
Made changes for greater compatibility with Keil, IAR, TI Code Composer and Arduino compilers.
endian.h to endianness.h to avoid header name clash on Linux.
Messaging and scheduler frameworks added
Monday, August 07, 2017
A set of modular template classes that can be mixed and matched together to provide message routing, message buses, finite state machines and cooperative schedulers.
All of the message framework classes are based on
etl::imessage_router, allowing combinations of Router/Bus/FSM.
The framework uses CRTP to eliminate the need for most virtual functions and enable direct calls to handler functions.
See Frameworks.

Also added 'generators' for several classes to allow the maximum number of handlers or types to be set according to project requirements.
See Generators.

Emplace support
Friday, July 21, 2017
Added emplace, emplace_front or emplace_back to several containers.
queue, priority_queue, list, forward_list, stack, vector
The emplace functions accept up to four parameters.

Added memcpy support to some containers
Saturday, June 17, 2017
vector, deque, string, wstring, u16string and u32string now have the ability to repair themselves after being copied by a low level method such as memcpy.
See the relevant container documentation for more details.

Fixes to map, set and list
Saturday, June 17, 2017
Fixed the definition of 'key' parameter types for map & set where a non POD key types were doubly declared as 'const&'.
Fixed list sort algorithms so that they are now 'stable'.
Added string hash definitions for top level types.
Added additional compatibility for targets that don't support 8 bit typ
Reference flat map/set + others
Wednesday, May 10, 2017
Added flat map & set containers that store references to objects.
Reduced the number of header files by merging container headers.
  i.e. vector.h = vector.h + ivector.h + vector_base.h
Modifications to improve cross compiler compatibility.
Made the unit test framework a sub
Flat map/set re-write + algorithms
Saturday, March 04, 2017
The flat map & set containers have been re-written to enhance the performance of inserts.
Completed addition of extension algorithm variants.

Performance improvements to etl::vector + new algorithms
Sunday, February 26, 2017
Performance improvements added to etl::vector, especially for fundamental types.
New algorithms added.
  transform (output iterator range version)

Re-write of the pool memory manager
Thursday, February 16, 2017
Re-write of the pool memory manager for enhanced performance, both in speed and memory usage.
Fixed a bug where vector & variant did not destruct contained items when destructed themselves.
Allocate and release are O(1) operations.

Added string classes & more
Saturday, August 20, 2016
Version 8.2.0
Added fixed capacity string classes; string, wstring, u16string, u32string.
Added typesafe typedef class.
Modifications to improve cross compiler compatibility.

Added signal debounce class
Tuesday, May 17, 2016
Added a signal debounce class that will debounce noisy signal edges.
Supports 'hold' and 'repeat' modes for use with keyboard inputs.

Customisable checksum. Intrusive list
Wednesday, February 10, 2016
Modified etl::checksum to allow customisation with policy classes.
Added etl::intrusive_list.
Updated intrusive_forward_list to include splice_after and merge functionality.

Error checking mods
Thursday, December 24, 2015
Small changes to error checking facilities.
Fixed bug in flat_set
Friday, December 18, 2015
Fixed a bug in flat_set where multiple instances of the same value were not being checked for.
Error checking redesigned
Friday, December 18, 2015
To give users of the library as many options as possible for error checking (or not) the error macros have been re-written.
See error_handler.

etl::bitset redesign
Wednesday, December 09, 2015
Redesigned bitset to use no virtual functions.
Moved code to ibitset to reduce code size.
Removed iterator functionality.
Fixed storage array type as uint8_t.

Intrusive lists & containers tutorial
Saturday, December 05, 2015
Added etl::intrusive_forward_list.
Added etl::basic_intrusive_forward_list for use as a very low cost list and for internal library use.
Added quick introduction tutorial to ETL container design and use.

Thursday, October 08, 2015
I've started a tutorial section.
So far I've added one for etl::function.

Current work
Saturday, September 26, 2015
I'm currently working on an intrusive list, with the intention of using it to implement unordered maps & sets.
Once these are complete then a set of cache containers will be added.

Intended caches will include:-
Random remove.
Least recently used.
Most recently used.

Bug in etl::vector
Saturday, September 19, 2015
I discovered a serious bug in the vector definition where declaring a vector of N capacity would allocate N^2 elements.
Now fixed in both master and development branches.

New containers
Saturday, July 25, 2015
Added map, multimap, set, multiset and priority_queue.
New aligned storage & IO ports
Monday, March 16, 2015
Removed the align_at and align_as classes and replaced them with an STL C++11 style aligned_storage.

Added io_port classes to allow mapping of IO ports without having to resort to possibly non-portable structure ovrrlays.
They can map memory locations of types read/write, read only, write only and write only with shadow value.
Allows compile time of runtime definition of the bases address.

Hashes, flat_map, flat_set
Sunday, February 22, 2015
etl::ihash. A base class for hash type algorithms has been added.
etl::flat_map & etl::flat_set containers added.

Roadmap V4?
Monday, February 16, 2015
The next set of changes planned include the following.
etl::map & etl::set
etl::unordered_map & etl::unordered_set
etl::string & etl:wstring
At some time in the future etl::utf8string?

V3.0 - Rewrite of containers
Sunday, February 15, 2015
The containers have re-written to allow elements that do not have default constructors.
An initial, as yet incomplete version of etl::map is included.
Binary utilities have been added.

Wednesday, January 14, 2015
At this time the containers are implemented using arrays as the internal storage. This can be a problem if the classes cannot have a default constructor or number of instances of a class are limited in some way.

Work is underway at the moment to modify them so that they will construct and destruct instances of the contained elements, to more closely follow the behavior of standard library containers.

Release at V1.1
Wednesday, December 10, 2014
Changes to etl::pool.
Hoisted common container code.

Initial release
Tuesday, December 09, 2014
Initial release at V1.0
ETL News


RSS Feed