C++26

From HandWiki

C++26 is the informal name for the version of the International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC) 14882 standard for the C++ programming language that follows C++23. The current working draft of this version is N5032.[1] 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.[2] The draft wording is feature complete,[3] and is being sent out for international comment ballot.[4] After resolving some ballot comments at the November 2025 standardization meeting in Kona, Hawaii, the C++ Standards Committee is expected to finish resolving ballot comments, technically finalize the draft, and send the draft out for final approval ballot at the following standardization meeting[3] in London, United Kingdom in March 23 to 28, 2026.[5][6]

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.

C++26 is officially shipped and done by WG21 in 28 March 2026.[7][8] According to Herb Sutter, C++26 is the most 'compelling' release since C++11.[8]

Features

Changes that have been accepted into C++26 include:

Language

  • Compile-time reflection.[9] (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 operator ^^ (colloquially called the "cat-ears operator"[10]) for invoking reflection, rather than the Reflection TS keyword reflexpr.
  • Support for annotations to be used in reflection which behave differently from the existing attribute system used by the compiler.[11] See also Java annotations.
  • Contracts[12] adding keyword contract_assert, and additionally identifiers with special meaning, pre and post.[13] (An experimental fork of Clang by Eric W Fiselier and a few GCC variants supporting contracts are available through the Compiler Explorer.)
  • User-generated static_assert messages[14]
  • Introduction of erroneous behaviour for reading uninitialized variables [15]
  • indeterminate attribute [16]
  • Deleting a pointer to an incomplete type should be ill-formed
  • Removing deprecated array comparisons
  • constexpr structured bindings and references to constexpr variables
  • constexpr placement new
  • constexpr cast from void*
  • constexpr containers and adaptors [17]
  • constexpr virtual inheritance[18]
  • constexpr exceptions[19]
  • Allowing exception throwing in constant-evaluation
  • Variadic 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 with void f(int a, ...);.[20]
  • Placeholder variables with no name[21]
  • 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 #embed directive (first introduced in C23) for binary resource inclusion and __has_embed allowing 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.
  • = delete("reason");, deleting methods/functions with a specified reason
  • Forbidding returning reference to a temporary variable in a function [22]
  • template for compile-time loops (a.k.a. expansion statements)[23] to iterate over type/parameter packs, tuple-like objects and meta-objects.[24]

Library

  • <meta>: Compile-time reflection support
  • <contracts>: Design-by-contract support
  • Bounds-hardened standard library[25]
  • Parallel scheduler providing a standard async execution context that guarantees forward progress[26]
  • <simd>: Data-parallel access (Single instruction, multiple data or SIMD) support
  • Async sender/receiver model for structured concurrency[27] (Libunifex is a prototype implementation that can be compiled in C++17 or later.)
  • <hazard_pointer>: Hazard pointers for threading
  • std::copyable_function
  • std::is_within_lifetime
  • <hive>: Hive data structure support which reuses erased elements' memory (similar to an object pool). It is based on plf::colony.
  • <rcu>: Support for safe reclamation read-copy-update mechanism
  • <inplace_vector>: In-place vector data structure support, which is a resizable, fixed capacity, inplace contiguous array
  • std::submdspan()
  • Native handles in file streams
  • std::formatter<std::filesystem::path>
  • Interfacing string streams with std::string_view
  • Interfacing std::bitset with std::string_view
  • std::views::concat
  • Concatenation of strings and string views
  • <text_encoding>: Support for accessing the IANA Character Sets registry
  • Printing blank lines with std::println() (already implemented in C++23 by most compiler vendors)
  • std::ranges::generate_random
  • <linalg>: A free function linear algebra interface based on the BLAS
  • Hashing support for std::chrono value classes
  • Added tuple protocol to std::complex
  • More constexpr for <cmath> and <complex>
  • Adding the new 2022 SI prefixes on ratios: std::quecto, std::ronto, std::ronna, and std::quetta
  • Saturation arithmetic with, among others, std::add_sat, std::div_sat
  • <debugging>: Debugging support and language features to aid debugger programs
  • <execution> expanded with an "execution control library" for asynchronous operations and coroutines, including a std::execution::task class[28]

Reception

Several people issued trip reports from the Sofia C++ Standards Committee meeting at which the draft became feature complete,[26][29] and from the International C++ Conference, C++ On Sea, immediately afterward.[30]

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 including reflection to C++ as a "whole new language."[26]

The contracts feature for C++26 has been criticised by some in the C++ committee, for varying reasons.[31]

The trivial relocatability feature, which proposed the new identifiers/class property specifiers trivially_relocatable_if_eligible and replaceable_if_eligible[32], was removed from C++26 due to implementation bugs and deferred to a later standard.[33]

See also

  • C2Y (C standard revision)

References

  1. "Working Draft, Standard for Programming Language C++". ISO/IEC. 2025-12-15. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5032.pdf. 
  2. "mailing2025-07 post-Sofia". https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/#mailing2025-07. 
  3. 3.0 3.1 "C++ IS Schedule". JTC1/SC22/WG21 - The C++ Standards Committee - ISOCPP. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p1000r6.pdf. 
  4. "The life of an ISO proposal: from "cool idea" to "international standard"". Standard C++ Foundation. https://isocpp.org/std/the-life-of-an-iso-proposal. 
  5. "Upcoming Meetings, Past Meetings". The Standard C++ Foundation. https://isocpp.org/std/meetings-and-participation/upcoming-meetings. 
  6. "N5024". Standard C++ Foundation. https://isocpp.org/files/papers/N5024.pdf. 
  7. Report from the Croydon 2026 ISO C++ Committee meeting, "C++26 was officially shipped by WG21 on Saturday, March 28, 2026!". 28 March 2026.
  8. 8.0 8.1 Sutter, Herb (29 March 2026). "C++26 is done! — Trip report: March 2026 ISO C++ standards meeting (London Croydon, UK)". https://herbsutter.com/2026/03/29/c26-is-done-trip-report-march-2026-iso-c-standards-meeting-london-croydon-uk/. 
  9. Wyatt Childers (26 June 2024). "P2996R4 - Reflection for C++26". WG21. https://isocpp.org/files/papers/P2996R4.html. 
  10. Herb Sutter (23 January 2026). "Reflection: C++'s Decade-Defining Rocket Engine - Herb Sutter - CppCon 2025". CppCon. https://www.youtube.com/watch?v=7z9NNrRDHQU. 
  11. Wyatt Childers, Dan Katz, Barry Rezvin, Daveed Vandevoorde (14 October 2024). "Annotations for Reflection". WG21. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3394r0.html. 
  12. "Contract assertions (since C++26) - cppreference.com". https://en.cppreference.com/w/cpp/language/contracts. 
  13. "C++ keywords - cppreference.com". https://en.cppreference.com/w/cpp/keywords.html. 
  14. Dargo, Sandor. "C++26: user-generated static_assert messages". The Standard C++ Foundation. https://isocpp.org/blog/2025/02/cpp26-user-generated-static-assert-messages-sandor-dargo. 
  15. Undefined Behavior, cppreference.com
  16. small safety improvements in the C++ core language
  17. constexpr containers and adaptors, openstd.org
  18. constexpr virtual inheritance, open-std.org
  19. constexpr exceptions, open-std.org.
  20. "P3176R1: The Oxford variadic comma". https://eisenwave.github.io/cpp-proposals/oxford-variadic-comma.html. 
  21. a nice placeholder with no name, open-std.org
  22. Improving Code Safety in C++26: Managers and Dangling References
  23. Expansion Statements open-std.org
  24. Trip report: June 2025 ISO C++ standards meeting (Sofia, Bulgaria). "(...) adds “template for” to make it easy to loop over reflection data at compile time." herbsutter.com. 2025-06-21
  25. Sutter, Herb. "Crate-training Tiamat, un-calling Cthulhu:Taming the UB monsters in C++". https://herbsutter.com/2025/03/. 
  26. 26.0 26.1 26.2 Sutter, Herb. "Trip report: June 2025 ISO C++ standards meeting (Sofia, Bulgaria)". https://herbsutter.com/2025/06/21/trip-report-june-2025-iso-c-standards-meeting-sofia-bulgaria/. 
  27. Sutter, Herb. "Trip report: Summer ISO C++ standards meeting (St Louis, MO, USA)". https://herbsutter.com/2024/07/02/trip-report-summer-iso-c-standards-meeting-st-louis-mo-usa/. 
  28. cppreference.com. "Execution control library (since C++26)". cppreference.com. https://en.cppreference.com/w/cpp/experimental/execution.html. 
  29. Lopez-Gomez, Javier. "Summer WG21 Meeting; trip report". https://jalopezg.dev/2025/06/30/Summer-WG21-Meeting-trip-report/. 
  30. Dargo, Sandor. "Trip report: C++ On Sea 2025". https://www.sandordargo.com/blog/2025/07/02/cpponsea-trip-report. 
  31. Timur Doumler (6 October 2025). "C++26 Contract Assertions, Reasserted". WG 21. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3846r0.pdf. 
  32. "C++ keywords - cppreference.com". https://en.cppreference.com/w/cpp/keywords.html. 
  33. Herb Sutter (10 November 2025). "Trip report: November 2025 ISO C++ standards meeting (Kona, USA)". Sutter's Mill. https://herbsutter.com/2025/11/10/trip-report-november-2025-iso-c-standards-meeting-kona-usa/.