We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
C++23: An Overview of Almost All New and Updated Features - Marc Gregoire - CppCon 2023
Get an in-depth overview of the new and updated features in C++23, including `std::span`, `std::optional`, `std::variant`, improved error handling, and more, from esteemed speaker Marc Gregoire at CppCon 2023.
- C++23 introduces new and updated features, expanding on what was available in C++20.
-
std::span
allows for easy manipulation of arrays or other containers, andstd::mdspan
supports multi-dimensional memory layouts. -
std::optional
adds new methods, includingas_value
,as_error
andvalue
, andstd::variant
is deprecated. -
The
<format>
header provides new string formatting APIs, includingstd::format
andstd::formattoa
. -
range
library enhancements includeflatten
,to
,first
, andlast
algorithms. -
std::visit
allows for flexible and concise expression of visit operation. -
C++23 supports
const
eval, which permits evaluation of expressions at compile time if possible. -
std::monostate
allows for creation of functions that can’t be instantiated. -
Improvements to error handling, including
unwrap
andunwrap_or_default
forstd::optional
. -
Garbage collection APIs are available, including
std::unique_ptr
. - Lambda expressions can now explicitly capture by value.
-
Overloadable
std::as_const
is added. -
More concise code can be achieved by using
nden
for lazy evaluation of optional values. - Performance improvements through reduction of unnecessary checking and reallocation.
- Changes to string and character representation, including integer literal suffix and extended character literal syntax.
- Extensions to set and map literals, including initialization with a type.
- Improved support for array and vector views.
-
Enhanced usability of
std::span
andstd::mdspan
. -
std::erase
andstd::erase_if
to remove elements from containers. - Many other minor improvements and fixes.
Note: Some of the described features are new in C++20, but also have enhancements in C++23.