C++26
Revision of the C++ programming language released in 2026
C++26 is the informal name for the open standard revision of the International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC) 14882 standard for the C++ programming language that follows C++23, officially shipped by WG21 on 28 March 2026. The final draft of C++26 was N5050. The next version, currently under development, is C++29.
Papers proposed and adopted into the standard by the C++ Standards Committee and minutes of the standardization meeting held at Sofia, Bulgaria and online in June 2025 are publicly available. The draft wording is feature complete, and is being sent out for international comment ballot. After resolving some ballot comments at the November 2025 standardization meeting in Kona, Hawaii, the C++ Standards Committee finished expected resolving ballot comments, technically finalized the draft, and send the draft out for final approval ballot at the following standardization meeting in London, United Kingdom from 23 to 28 of March 2026.
Experimental and standard compilers implementing some of the upcoming features can be tried on short code snippets through the Compiler Explorer. Some of the compiler variants are distinguished only by the short identifiers of papers proposing the new features they implement, such as "P3372" for constexpr containers and adaptors.
No compiler fully supports C++26 yet, or defaults to it. As of 30 April 2026, GCC supports most of the C++26 features beginning with GCC 16.1.
As of 2026, C++26 is the next revision of the C++ programming language standard. ISO/IEC JTC 1/SC 22/WG21 is responsible for the standardization process. N5046 was the May 2026 working draft (replacing N5032); the Draft International Standard was not completed for ISO ballot at that time. Compiler implementations began development for C++26 support before the standard was finalised. GCC has implemented some C++26 features with the flag -std=c++26, but is still experimental as the ISO C++26 standard was finalizing its standardization. The ISO Draft International Standard (DIS) ballot for C++26 draft standard approval closed on 13 October 2026, but failed to pass; the vote received a 60% approval (requiring a 66.67% threshold), with 9 of 22 countries (Denmark, Finland, Iran, Italy, Japan, Luxembourg, Romania, Spain and Sweden) voting no. A second finalisation of technical work was completed on 21 November 2026, addressing remaining comments (primarily for contracts).
Features
Changes that have been accepted into C++26 include:
Language
- Reflection, which runs at compile-time (unlike languages like Java and C#, which run at runtime). (An experimental fork of Clang by Dan Katz, as well as GCC 16, implement these features. These compilers as well as another implementation from EDG can all be tried through the Compiler Explorer.) This uses a new reflection operator
^^(colloquially called the "cat-ears operator") which creates a mirror primitivestd::meta::info(rather than the Reflection TS keywordreflexpr), which can be spliced back into source code using the[: :]splice specifiers. - Annotations, which attach reflective metadata to an object (and are processed later than compiler attributes).
- Contracts adding keyword
contract_assert, and additionally identifiers with special meaning,preandpost. (An experimental fork of Clang by Eric W Fiselier and a few GCC variants supporting contracts are available through the Compiler Explorer.)- Contracts can be made to always be enforced, using the
std::contracts::controls::enforcedobject, withpre<enforced>(),post<enforced>(),contract_assert<enforced>(). The item betwen the angle brackets must always denote/resolve tostd::contracts::controls::enforced.
- Contracts can be made to always be enforced, using the
- User-generated
static_assertmessages, which supportconstexprmessages rather than just unevaluated strings - Introduction of erroneous behaviour for reading uninitialized variables
[[indeterminate]]attribute, which indicates that a variable or function parameter has an indeterminate value if not initialized- Deprecate
std::memory_order::consumeandstd::kill_dependency(), due to complicating the memory model and low compiler adoption - Remove
[[carries_dependency]]attribute, due to the deprecation ofstd::memory_order::consume - Deleting a pointer to an incomplete type should be ill-formed
- Removing deprecated array comparisons
- Various constexpr improvements:
constexprstructured bindings and references toconstexprvariablesconstexprplacementnewconstexprcast fromvoid*constexprcontainers and adaptorsconstexprvirtual inheritanceconstexprexceptions, allowing exception throwing in constant-evaluation
- Variadic friends (
friend Friends...;) - Oxford variadic comma, i.e. "Deprecate ellipsis parameters without a preceding comma." For example, the syntax
void f(int a...);is incompatible with C, detrimental to C++, and easily replaceable withvoid f(int a, ...);. - Placeholder variables with no name, using the underscore as the identifier (e.g.,
int _ = player.getScore();variables using_as the identifier are implicitly given the[[maybe_unused]]attribute. The_identifier may be reused and re-declared in the same scope, and may be used multiple times in structured bindings (such asauto [_, username, _] = getUserData();). - Ordering of constraints involving fold expressions
- Pack indexing
- Structured bindings can introduce a pack
- Attributes for structured bindings
- Structured binding declaration as a condition
- Adds
#embeddirective (first introduced in C23) for binary resource inclusion and__has_embedallowing the availability of a resource to be checked by preprocessor directives - Unevaluated strings
- Adding
@,$, and`to the basic character set. While currently unused, this would allow those characters to be given potential use in the future. - Disabling special member functions with a specified reason (
= delete("Deletion reason here");) - Forbidding returning reference to a temporary variable in a function
template forcompile-time loops (a.k.a. expansion statements) to iterate over type/parameter packs, tuple-like objects and meta-objects.- Allow attaching the entry point,
main, to the global module. This allows themain()function to haveextern "C++"linkage. std::string_view,std::span, andstd::tupleare now structural types
Library
- New standard library headers and namespaces:
<contracts>: Contracts support, and namespacestd::contracts<debugging>: Debugging support and language features to aid debugger programs<hazard_pointer>: Hazard pointers for threading<hive>: Hive data structure support which reuses erased elements' memory (similar to an object pool). It is based onplf::colony.<inplace_vector>: In-place vector data structure support, which is a resizable, fixed capacity, inplace contiguous array<linalg>: A free function linear algebra interface based on the BLAS, and namespacestd::linalg. It is based on Kokkos's stdBLAS implementation.<meta>: Compile-time reflection support, and namespacestd::meta<rcu>: Support for safe reclamation read-copy-update mechanism<simd>: Data-parallel access (Single instruction, multiple data or SIMD) support, and namespacestd::simd<text_encoding>: Support for accessing the IANA Character Sets registry
- Parallel scheduler (in
<execution>) providing a lazily-evaluated standard asynchronous execution context that guarantees forward progress, with the "execution control library" for asynchronous operations and coroutines in namespacestd::execution. It provides abstractions for "senders", "receivers", and "schedulers" and a designatedstd::execution::task<T, Env>class (which is itself a sender). It was proposed based on Meta's libunifex framework, and later Nvidia's stdexec framework.std::execution::scheduler<Sch>is a concept representing an execution engine.std::execution::sender<Snd>is a concept representing an async pipeline.std::execution::receiver<Rcv>is a concept representing a callback/sink.
- "Hardened" standard library, which includes bounds checking and turns instances of undefined behavior into contract violations
- New cancellation tokens (stop tokens) inside
<stop_token>, likestd::inplace_stop_token,std::never_stop_token, and concepts likestd::stoppable_token<Tok>,std::unstoppable_token<Tok> std::copyable_function, general-purpose polymorphic function wrapper which may be copy-constructed and copy-assignedstd::is_within_lifetime, determines if a pointer points to an object that is within its lifetimestd::submdspan(), returns a view of a subset of an existingstd::mdspan- Native handles in file streams
- Support for
std::optional<T&>, an optional storing a reference - Specialization of
std::formatter<>forstd::filesystem::path(std::formatter<std::filesystem::path>) - Interfacing string streams with
std::string_view - Interfacing
std::bitsetwithstd::string_view std::views::concat, a view for concatenation of other views- Concatenation of strings and string views
- Printing blank lines with
std::println()(already implemented in C++23 by most compiler vendors) std::ranges::generate_random, fills a range with random numbers from a uniform random bit generator- Hashing support for
std::chronovalue classes - Added tuple protocol to
std::complex - More
constexprfor<cmath>and<complex> - Adding the new 2022 SI prefixes on ratios:
std::quecto,std::ronto,std::ronna, andstd::quetta - Saturation arithmetic:
std::saturating_add,std::saturating_sub,std::saturating_mul,std::saturating_divandstd::saturating_cast
Reception
Several people issued trip reports from the Sofia C++ Standards Committee meeting at which the draft became feature complete, and from the International C++ Conference, C++ On Sea, immediately afterward.
All highlighted the introduction of compile-time reflection in particular as a major change. In particular, Herb Sutter, chair of the ISO C++ Standards Committee and Hana Dusíková, assistant chair of the "Language Evolution" working group of the C++ Standards Committee, described the potential impacts for C++ reflection as a "whole new language." Sutter further described C++26 as the most 'compelling' release since C++11.
The contracts feature (proposal P2900), was criticised by some in the C++ committee, for varying reasons (such as questioning its safety, complexity, or implementation details); this has been such a point of contention that the October 2026 final publication was disapproved due to the DIS ballot failing, apparently over the inclusion of contracts for C++26; in particular, creator of C++ Bjarne Stroustrup listed several concerns on fundamental flaws with the existing design, though he stated he was not opposed to contracts in general. In general, there is agreement that some form of contracts is desirable, but there is disagreement on P2900 as the design.
The trivial relocatability feature, which proposed new specifiers trivially_relocatable_if_eligible and replaceable_if_eligible, was removed from C++26 due to implementation bugs and deferred to a later standard.
Adapted from the Wikipedia article, CC BY-SA 4.0. Continue on Wikipedia
Go deeper
Ideas this article links to.