B.5 — Introduction to C++23
January 25, 2024, 1:33 pm PST January 17, 2025
What is C++23?
In February of 2023, the ISO (International Organization for Standardization) approved a new version of C++, called C++23.
New improvements in C++23
For your interest, here’s a list of the major changes that C++23 adds. Note that this list is not comprehensive, but rather intended to highlight some of the key changes of interest.
- Constexpr
(e.g. std::abs()
), and(6.7 — Relational operators and floating point comparisons). - Constexpr
std::unique_ptr
(no lesson yet). - Explicit
this
parameter (no lesson yet). - Fixed-size floating point types (via
) (no lesson yet). - Formatted printing functions
std::print
andstd::println
(no lesson yet) - Literal suffixes for
std::size_t
and the corresponding signed type (5.2 — Literals). - Multidimensional subscript
operator[]
(Mentioned in lesson 17.13 — Multidimensional std::array). - Multidimensional span
std::mdspan
(17.13 — Multidimensional std::array). - Preprocessor directives
#elifdef
and#elifndef
(no lesson yet). - Preprocessor directive
#warning
(no lesson yet). - Stacktrace library (no lesson yet)
- Standard library modules
std
(andstd.compat
) (no lesson yet). - Static
operator()
andoperator[]
(no lesson yet). std::bitset
now fully constexpr.std::expected
(no lesson yet)std::ranges
algorithmsstarts_with
,ends_with
,contains
(no lesson yet)std::string::contains
andstd::string_view::contains
(no lesson yet)std::to_underlying
to get the underlying type of enum (13.6 — Scoped enumerations (enum classes)).std::unreachable()
(no lesson yet).- Using unknown pointers and references in constant expressions (17.2 — std::array length and indexing).
[Next lesson
C.1The end?](https://www.learncpp.com/cpp-tutorial/appendix-c-the-end/) Back to table of contents [Previous lesson
B.4Introduction to C++20](https://www.learncpp.com/cpp-tutorial/introduction-to-c20/)
Previous Post16.5 — Returning std::vector, and an introduction to move semantics
Next Post12.15 — std::optional
[wpDiscuz](javascript:void(0);)
Insert
You are going to send email to
Send
Move Comment
Move