reloco

reloco logo

reloco (“Reliable Components”) is a header-only C++17 library of Safety by Default replacements for Standard Library containers and value-lifetime primitives. Anything that can fail — an out-of-bounds index, a use of a moved-from value, a stale pointer — is rejected at compile time or returned as an explicit result<T> instead of undefined behavior or an exception. It is meant for firmware, RTOS and interrupt code, crash handlers and kernel-adjacent code.

Source and issue tracker: github.com/jplcz/reloco.

Where to start

New here? Read in this order: the Hardened containers guide explains the three-tier (checked / try_ / unsafe_) access convention everything else follows, Lifetime safety explains borrowed values, and Fallible construction explains how allocation failure is reported. Then pick the container or primitive you need.

Safety model

Containers

Pointers, ownership and memory

Concurrency

Binary data and utilities

Kernel framework (C++20+)

Tooling and integration

Reference