# C++23 Library Features and Reference Cards

DevFeed: [C++23 Library Features and Reference Cards](<https://devfeed.tech/articles/c-23-library-features-and-reference-cards-53304.md>)

Original publisher: [Read original article](<https://www.cppstories.com/2024/cpp23_lib/>)

Published: 2024-12-08T00:00:00Z

Content type: article

Language: en

Sources: [C++ Stories](<https://devfeed.tech/sources/c-stories.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Library](<https://devfeed.tech/topics/library.md>), [Code](<https://devfeed.tech/topics/code.md>), [standard](<https://devfeed.tech/topics/standard.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>)

Tags: [c-plus-plus-23](<https://devfeed.tech/tags/c-plus-plus-23.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [headers](<https://devfeed.tech/tags/headers.md>), [library](<https://devfeed.tech/tags/library.md>), [reference](<https://devfeed.tech/tags/reference.md>), [standard](<https://devfeed.tech/tags/standard.md>)

## AI overview

A reference guide to C++23 standard library features, covering new headers, stacktrace support, scoped-enum utilities, pointer wrappers, container construction, ranges algorithms, and view additions. It includes short explanations and code examples.

## Source excerpt

In this blog post, you'll see all C++23 library features! Each with a short description and additional code example. Prepare for a ride! For language features please see the previous article: C++23 Language Features and Reference Cards - C++ Stories Want your own copy to print? If you like, I prepared PDF I packed both language and the Standard Library features. Each one has a short description and an example if possible. All of the existing subscribers of my mailing list have already got the new document, so If you want to download it just subscribe here: Download a free copy of C++23 Ref Card! Please notice that along with the new ref card you'll also get C++20 and C++17 language reference card that I initially published three years ago. With this "package" you'll quickly learn about all of the latest parts that Modern C++ acquired over the last few years. New Headers expected flat_map, flat_set generator mdspan print spanstream stacktrace stdfloat Stacktrace Library P0881 Based on Boost.Stacktrace allows for more context when debugging code. The library defines components to store the stacktrace of the current thread of execution and query information about the stored stacktrace at runtime. #include <iostream> #include <stacktrace> void foo() { std::cout << std::stacktrace::current(); } int main() { [] { foo(); }(); } Experiment @Compiler Explorer, note that GCC 14 requires to be linked with -lstdc++exp. Possible output on GCC: 0# foo() at /app/example.cpp:5 1# operator() at /app/example.cpp:10 2# main at /app/example.cpp:11 3# at :0 4# __libc_start_main at :0 5# _start at :0 is_scoped_enum & to_underlying P1048R1 (is_scoped_enum), P1682R3 (to_underlying) #include <print> #include <utility> // for std::to_underlying enum class Color: uint8_t { Red = 1, Green = 2, Blue = 3 }; enum Col { Red, Green, Blue }; int main() { Color c = Color::Blue; // Pre-C++23: verbose casting auto old_way = static_cast<std::underlying_type_t<Color>>(c); // C++23: clean and simple auto