Papers
WG21 proposals explained: motivation, design trade-offs and the final wording.
Getting started
Core language
Guaranteed copy elision (P0135)How C++17 lets types that can be neither copied nor moved be returned by value from factory functions. P0135 did not change copy elision from permitted to required; it redefined prvalues so that, until materialized, a prvalue is not an object at all.draftproposalcopy elisionvalue categoriesprvalueImplicit object creation (P0593)C++20, as a defect fix, specifies that operations like malloc, operator new and memcpy create objects on demand, giving C-style low-level code defined behavior. This page covers the problem it solves, the rejected alternatives, the final wording, and why std::start_lifetime_as was still needed afterwards.draftproposalobject modellifetimemallocRewriting declarations and lookup (P1787)C++23's P1787R6 rewrote the wording for scopes and name lookup. What was wrong with the old wording, which concepts the new wording introduced, which behaviors actually changed and which rules were merely spelled out, and how compilers implement it today.draftname lookupscopeproposalDRExplicit object parameters (P0847)C++23 lets a member function write the object it is called on as a first parameter marked with this, so the object's type, constness and value category can be deduced. The duplicated code it targets, the syntaxes and lookup rules the proposal compared, why the final design gives the body no this, makes taking the address yield an ordinary function pointer and forbids virtual, the hidden problems of deducing a derived type, and how the standard library uses it.draftdeducing thisexplicit object parametermember functionsCRTPSimpler implicit move (P1825, P2266)When return x; moves instead of copying. From C++11's two-stage overload resolution borrowed from the copy elision conditions, through the gradual relaxations of CWG1579 and P1825, to C++23's P2266 making the returned name an xvalue outright, and which code changed meaning at each step.draftimplicit movevalue categoriesxvaluecopy elisionClass types as template parameters (P0732, P1907)How C++20 let class types and floating-point numbers become constant template parameters. The first design used the defaulted <=> to decide whether two arguments are the same; after a series of inconsistencies came to light it was replaced by member-wise structural types, and that choice is behind today's rules for fixed_string, -0.0 and private members.draftproposaltemplatesconstant template parametersNTTP
C++26
Static reflection (P2996)C++26 lets a program query types, members and enumerators at compile time as std::meta::info values, and splice them back into code with [: :]. Why it chose a single opaque value-based type, why the token is ^^, how access control and error handling were settled, and which capabilities were deferred.draftreflectionmetaprogrammingconstevalC++26Contracts (P2900)How P2900 made preconditions, postconditions and assertions part of the language. Why pre/post/contract_assert rather than attribute syntax or assert; why whether to check is left to the build instead of written on each assertion; why predicates are treated as const and may be evaluated zero or more times; and the gaps the minimum viable product leaves on purpose, along with the objections that remain.draftcontractsproposalC++26assertionsstd::execution (P2300)Why C++26's sender/receiver model replaced futures, coroutines and executors as the foundation of standard asynchrony. What laziness, three completion channels, allocation-free connect/start, stop tokens, structured concurrency and member-function customization each solve, and what each costs.draftstd::executionsendersreceiversasynchronyErroneous behavior and uninitialized reads (P2795)How C++26 deals with reading uninitialized local variables, a common security hole. Why zero-initializing everything was not adopted and a new category of behavior, erroneous behavior, was added instead, so that uninitialized automatic variables hold an erroneous value chosen by the implementation, with [[indeterminate]] as the escape hatch for performance-sensitive code; and how far Clang 23 is from these semantics today.drafterroneous behavioruninitializedUBsecurityTrivial relocation (P2786 and P1144)When moving an object to new memory, can a single memcpy replace a move construction plus destruction? The library practice of twenty years, where the two competing proposals disagreed on assignment semantics, explicit declarations and whether memcpy is enough, how P2786 entered C++26 and was then removed, and what libc++ already does today when growing a vector.draftproposaltrivial relocationmove semanticsobject modelExceptions at compile time (P3068)C++26 lets constant evaluation throw and catch exceptions, as long as the exception object is destroyed within the same evaluation. Why compile-time code used to need two error paths, what the alternatives were, how the wording changes only two items in [expr.const], how the library's exception types followed, and why uncaught_exceptions and current_exception had their constexpr withdrawn again.draftconstexprexceptionsconstant evaluationconstevalPack indexing (P2662)C++26 uses Ts...[N] and args...[N] to get the Nth type or element of a pack directly. How much compile time the earlier recursive templates, detours through tuple and inheritance-based deduction cost, why the syntaxes and library approaches the proposal compared lost out, why negative indices and deduction were excluded, and how unnamed T...[n] parameters change meaning as a result.draftpack indexingvariadic templatespack expansiontemplate metaprogramming
Library
mdspan (P0009)C++23's std::mdspan is a multidimensional view over a block of memory, made of three parts: shape, layout and accessor. The older idioms it replaces, the layout problem it inherited from Kokkos, why the shape is written as extents rather than an array type, why there are exactly two customization policies, why m[i, j] required a language change first, why it is not a range, and C++26's submdspan and padded layouts.draftmdspanmultidimensional arraysviewslayoutsstd::format and std::print (P0645, P2093, P2286)How C++20's std::format and C++23's std::print avoid the drawbacks of both printf and iostream: Python-style format strings, locale independence by default, extension by specializing formatter, and type erasure to control code size. Why compile-time checking of format strings is done with a consteval constructor and why that counted as a breaking change; how print handles Unicode on the Windows console; how ranges are output by default; and how runtime format strings evolved from vformat to dynamic_format.draftproposalstandard libraryformatprintranges::to and constructing containers from ranges (P1206)C++20 views had no way back to containers, so P1206 added ranges::to plus from_range constructors and *_range members to every standard container. Why it ended up as a free function plus a tag, why the four construction methods are tried in this order, and the later fixes and C++26's reserve_hint.draftproposalrangesranges::tocontainersstd::generator (P2502)C++20 had coroutines but no coroutine types, so everyone wrote their own generators. How C++23's std::generator decided that its first template argument is the reference type, that it yields T&& by default, and that co_yield of an lvalue copies; why recursive generation uses one type and one active stack; why the allocator is passed in as a parameter; and why it is only a single-pass, move-only view.draftgeneratorcoroutinesrangesviewsStandard library hardening (P3471)How C++26 turns library UB such as vector out-of-bounds access or dereferencing an empty optional into guaranteed termination. A subset of existing preconditions is marked as hardened preconditions, and whether a hardened implementation is provided is implementation-defined. Why only cheap bounds checks were chosen, why the contract violation mechanism was borrowed, and why the observe semantic was later excluded.drafthardeningsafetypreconditionscontracts