encyclopegia.org

C++23

C++23, formally ISO/IEC 14882:2024, is a version standard for the C++ programming language, published in 2024.[src] It follows C++20, and was replaced by C++26 in March 2026.[src] The final draft of this version is N4950, which was technically finalized by WG21 in February 2023.[src]

C++23, formally ISO/IEC 14882:2024, is a version standard for the C++ programming language, published in 2024.[src] It follows C++20, and was replaced by C++26 in March 2026.[src] The final draft of this version is N4950, which was technically finalized by WG21 in February 2023.[src] explicit this object parameter if consteval multidimensional subscript operator; this operator may be defined with any number of parameters (or even be variadic), allowing for defining a[i, j, k] = x; instead of a[i][j][k] = x; static call and subscript operators and static lambdas simplifying implicit move auto(x) and auto{x} new preprocessor directives: #elifdef and #elifndef #warning extending the lifetime of some temporaries in range-based for loop new standard attribute assume(expression) class template argument deduction from inherited constructors labels at the end of compound statements alias declarations in init-statements literal suffixes for size_t and the corresponding signed type: (such as 0zu , 15zu ) extended floating-point types with literals (conditionally supported) optional () from nullary lambda expressions attributes on lambda expressions constexpr changes: non-literal variables, labels, and goto s in constexpr functions allowing static and thread_local variables that are usable in constant expressions in constexpr functions constexpr function does not need its return type and parameter types to be literal type it is now possible to write a constexpr function for which no invocation satisfies the requirements of a core constant expression narrowing contextual conversions to bool in static_assert and if constexpr trimming whitespaces before line splicing make declaration order layout mandated delimited escape sequences named universal character escapes text encoding changes: support for UTF-8 as a portable source file encoding consistent character literal encoding character sets and encodings New meaning added to some keywords, such as for this .[src] constexpr support for: std::type_info::operator== std::bitset std::unique_ptr for some functions for integral overloads of std::to_chars and std::from_chars metaprogramming utilities: type traits std::is_scoped_enum , std::is_implicit_lifetime , std::reference_constructs_from_temporary , and std::reference_converts_from_temporary .[src] adding move-only types support for comparison concepts making multi-param constructors of some views explicit disabling construction from nullptr for std::basic_string and std::basic_string_view explicit range constructor for std::basic_string_view std::basic_string::resize_and_overwrite rvalue reference overload of std::basic_string::substr for efficient slicing formatting ranges, tuples, escaped presentation of characters and strings, std::thread::id , and stacktraces.[src] std::basic_ostream::operator fixing the compatibility and portability of char8_t relaxing requirements on wchar_t to match existing practices allowing some pointers and references of this or unknown origin in constant expressions introduction of immediate-escalating functions promoted to immediate functions allowing static_assert(false) in uninstantiated template contexts fully constexpr std::variant and std::optional supporting types derived from std::variant in std::visit Use of comma operator in subscript expressions was no longer deprecated but the semantics has been changed to support overloadable n -adic operator[] .[src] C headers (The corresponding headers for compatibility with C) Clang progressively added partial C++23 support from 2021 in version 13 through to version 18 in 2024, available through the option -std=c++23 .[src] GCC added partial, experimental C++23 support in 2021 in version 11 through the option -std=c++2b or -std=c++23 It also has an option to enable GNU extensions in addition to the experimental C++23 support, -std=gnu++2b .[src] Consteval if ( if consteval ).[src] Narrowing contextual conversions to bool .[src] Allowing duplicate attributes.[src] -based string-stream ( ).[src] and .[src] constexpr for , , and .[src] Iterators pair constructors for (stack) and (queue).[src] Few changes of the ranges library: Generalized and for arbitrary ranges.[src] Renamed to and new .[src] Relaxing the constraint on .[src] Removing constraint from concept .[src] Range constructor for .[src] Prohibiting and construction from nullptr .[src] .[src] Improvements on .[src] Adding default arguments for 's forwarding constructor.[src] Non-literal variables, labels, and gotos in constexpr functions, but still ill-formed to evaluate them at compile-time.[src] Explicit this object parameter.[src] Changes on character sets and encodings.[src] New preprocessors: #elifdef and #elifndef .[src] Both directives were added to C23 (C language update) and GCC 12.[src] Allowing alias declarations in init-statement.[src] Overloading multidimensional subscript operator (e.g.[src] ).[src] Decay copy in language: auto(x) or auto{x} .[src] Changes in text formatting library: Fixing locale handling in chrono formatters.[src] Use of forwarding references in format arguments to allow -like types.[src] Addition of type alias which is equivalent to .[src] Changes in ranges library: Refined definition of a view.[src] Replacing function template with alias templates , , and customization point object .[src] range adaptor family: (and being equivalent to ) (and being equivalent to ) .[src] Monadic operations for .[src] Member function template .[src] Printing volatile pointers ( volatile T* ).[src] .[src] Heterogeneous erasure overloads for associative containers.[src] Every specialization of and is trivially copyable.[src] Adding conditional noexcept specifications to .[src] Revamped specification and use of integer-class types.[src] Clarify C headers.[src] "The headers are not useful in code that is only required to be valid C++.[src] Therefore, the C headers should be provided by the C++ standard library as a fully-supported, not deprecated part, but they should also be discouraged for use in code that is not polyglot interoperability code.[src] [..] This proposal makes the C headers no longer deprecated, so there is no formal threat of future removal.[src] The effective discouragement to use the C headers in pure C++ code is now spelled out explicitly as normative discouragement." constexpr for cmath and cstdlib Function to mark unreachable code A type trait to detect reference binding to temporary Making Pipe support for user-defined range adaptors , and Windowing range adaptors: and Allowed the this pointer and references of unknown origin to appear in constant expressions.[src] Allowed implementations to define extended floating-point types in addition to the three standard floating-point types.[src] Added the type aliases std::float16_t , std::float32_t , std::float64_t , std::float128_t , std::bfloat16_t for these extended types accessible through the header , their corresponding literal suffixes f16 f32 f64 f128 bf16 or F16 F32 F64 F128 BF16 and added overloads to various standard library functions that take floats as arguments.[src] Added the attribute which allows the compiler to assume the provided expression is true to allow optimizations.[src] Made support for UTF-8 source files mandatory, providing a portable encoding for source files.[src] Allowed arrays of and to be initialized with UTF-8 string literals.[src] Removed the requirement that can encode all characters of the extended character set, in effect allowing UTF-16 to be used for wide string literals.[src] Added std::mdspan , a multidimensional array view analogous to std::span .[src] and were added to the standard library.[src] Added the and functions for printing formatted text to stdout.[src] Provide the named modules and for importing the standard library.[src] Added support for exclusive mode fstreams , analogous to the "x" flag in fopen .[src] Allowed std::format to handle ranges, tuples, and other containers.[src] Added std::forward_like .[src] Made std::string::substr use move semantics.[src] Added which implements a coroutine generator that models , , , , .[src] Added new algorithms: , , and ranges fold algorithms.[src] Made std::tuple compatible with other tuple-like objects.[src] Explicit lifetime management for implicit-lifetime types.[src] Made std::bitset and integral overloads of std::to_chars and std::from_chars -compatible.[src] Adding move-only types support for comparison concepts.[src] Ranges iterators as inputs to non-ranges algorithms.[src] Relaxing range adaptors to allow for move-only types.[src] === November 2022=== After the hybrid WG21 meeting of 7 November 2022, the following features and defect reports are added where they were approved by straw polls: Allowed to be .[src] Allowed and variables to appear in functions if they are usable in constant expressions.[src] propagates upwards, that is, certain existing functions become functions when those functions can already only be invoked during compile time.[src] Extended the lifetime of temporaries that appear in the for-range-initializer of a range-based loop to cover the entire loop.[src] Reverted the deprecation of (all, not just bitwise) compound assignment to variables.[src] Monadic functions for .[src] Synchronize the output of with the underlying stream if the native Unicode API is used.[src] === February 2023=== After the final hybrid WG21 meeting of 6-11 February 2023, the following features and defect reports are added where they were approved by straw polls: Referencing the Unicode Standard.[src] Stashing stashing iterators for proper flattening.[src] views::enumerate making multi-param constructors of views explicit relaxing ranges just a smidge escaping improvements in std::format improving std::format 's width estimation std::format fill character allowances formatting thread::id and stacktrace A type trait std::is_implicit_lifetime std::common_reference_t of std::reference_wrapper should be a reference type disallowing user specialization of std::allocator_traits std::pmr::generator deprecating std::numeric_limits::has_denorm std::barrier 's phase completion guarantees ==References== ==External links== Compiler support for C++23 features - cppreference.com[src]

88 sentences · 88 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"C++23." encyclopegia.org, 2026, https://encyclopegia.org/wiki/c-23. Accessed 30 November 2026.

Chicago

"C++23." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/c-23.

APA

encyclopegia.org. (2026). C++23. Retrieved November 30, 2026, from https://encyclopegia.org/wiki/c-23

Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
publication date2024Wikipedia

Related articles

January 23

stub · references available

June 23

stub · references available

August 23

stub · references available

Messier 23

stub · references available

National road 23

stub · references available

Preludes, Op. 23

stub · references available

S/2003 J 23

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1378162962 · 0.5 · snapshot enwiki-001378162962

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.