C++ distinguishes between hosted and freestanding implementations. Freestanding targets environments without an OS — embedded systems, kernels, bare-metal — where heap allocation, exceptions, and system calls may be unavailable. The standard guarantees a minimal subset of headers like <cstdint>, <cstddef>, <type_traits>, and parts of <new>, while excluding OS-dependent components like <thread>, <filesystem>, and <iostream>. From C++20 through C++26, the freestanding subset has been steadily expanded to include algorithms, std::span, std::expected, std::mdspan, and smart pointer adapters, enabling more expressive code in constrained environments.

4m read timeFrom sandordargo.com
Post cover image
Table of contents
Two kinds of implementationsWhat is actually guaranteed in freestandingThe evolution of freestanding in modern C++ConclusionConnect deeper

Sort: