---
title: "ETL Fixed Containers"
description: "Verified on native_sim only. ETL is header-only and portable; on-target the same #includes and API calls build and run unchanged."
source: https://docs.alplab.ai/sdk/examples/etl-fixed-containers
---

# `etl-fixed-containers`

:::warning[`[UNTESTED]` on real silicon]
Verified on `native_sim` only. ETL is header-only and portable; on-target the same `#include`s and API calls build and run unchanged.
:::

Fixed-capacity containers with **no heap and no STL**, via the vendored [Embedded Template Library](https://www.etlcpp.com/) (ETL 20.39.4).

Source: [`examples/peripheral-io/etl-fixed-containers/`](https://github.com/alplabai/alp-sdk/tree/main/examples/peripheral-io/etl-fixed-containers).

## What it does

Builds two fixed-capacity containers and exercises them:

- `etl::vector<int, 8>` — `push_back`, `size`, `capacity`, and a range-for sum.
- `etl::map<const char *, int, 4>` — `operator[]` insert plus a `find()` lookup.

Capacity is part of the type, so all storage is inline — nothing reaches an allocator.

## Why it matters on an MCU

The SDK builds M-class apps with no heap on the hot path and no exceptions. ETL is the direct answer to "I want `std::vector` semantics without `std::vector`'s allocator":

- `prj.conf` deliberately does **not** set `CONFIG_REQUIRES_FULL_LIBCPP`, so the example builds in `ETL_NO_STL` mode.
- `ETL_NO_EXCEPTIONS` routes over-capacity through `etl_error_handler` rather than throwing.

ETL is header-only, so it has no Kconfig knob of its own — `libraries: [etl]` just puts the vendored headers and the SDK's `etl_profile.h` on the include path.

## `board.yaml`

```yaml
libraries:
  - name: etl
    cores: [m55_hp]

som:
  sku: E1M-AEN801

preset: e1m-evk
supported_boards:
  - e1m-evk
  - e1m-x-evk

cores:
  m55_hp:
    app: ./src
    peripherals: []

diagnostics:
  log_level: info
```

Pure logic — no peripherals, no chips.

## Expected output

```
[etl-fixed-containers] vector: size=5 capacity=8
[etl-fixed-containers] vector: sum=15
[etl-fixed-containers] map: size=3
[etl-fixed-containers] map: lookup("b") = 2
[etl-fixed-containers] done
```

## See also

- [`fmt-formatting`](https://docs.alplab.ai/sdk/examples/fmt-formatting) — the other header-only C++ library example
- [Examples overview](https://docs.alplab.ai/sdk/examples/overview)
