C++ 26
C++26
Breaking: ISO C++ Committee officially shipped C++26 on March 28, 2026 at the London (Croydon) meeting. This is the latest revision of the C++ programming language, following C++23 (ISO/IEC 14882:2024). The new standard brings compile-time reflection, contracts, a parallel scheduler, and major standard library additions.
Compile-Time Reflection
C++26 introduces compile-time reflection using the new ^^ operator (colloquially called the "cat-ears operator"). This replaces the earlier reflexpr keyword from the Reflection TS. The new <meta> header provides library support for inspecting and generating code at compile time. Experimental implementations are available in GCC 16 and a Clang fork by Dan Katz.
Contracts
Design-by-contract support lands via the new <contracts> header. The contract_assert keyword enables runtime contract checking, while pre and post become identifiers with special meaning for specifying function preconditions and postconditions.
Parallel Scheduler and Execution Control
A new parallel scheduler in <execution> provides a standard async execution context that guarantees forward progress. The "execution control library" adds support for asynchronous operations and coroutines, including a std::execution::task class for managing concurrent work.
Key Standard Library Additions
- std::copyable_function — A general-purpose polymorphic function wrapper that supports copy construction and assignment
- std::is_within_lifetime — Determines if a pointer points to an object within its lifetime
- std::submdspan() — Returns a view of a subset of an existing
std::mdspan - std::formatter<std::filesystem::path> — Specialization for formatting filesystem paths
- std::views::concat — A view for concatenating other views together
- std::ranges::generate_random — Fills a range with random numbers from a uniform random bit generator
- std::println() improvements — Printing blank lines with
std::println()(already implemented in C++23 by most compilers) - Interfacing string streams and
std::bitsetwithstd::string_view
Deprecations and Removals
- Deprecated
std::memory_order::consumeandstd::kill_dependency()due to low compiler adoption and complexity - Removed the
[[carries_dependency]]attribute due to the deprecation of memory_order::consume
Compiler Support
GCC 16.1 (released May 8, 2026) supports most C++26 features including contracts, reflection, and the new standard library additions. Clang is progressively implementing reflection through experimental forks. EDG also provides a reflection implementation. Developers can test features on Compiler Explorer (godbolt.org).