A Tour of C++ for experienced programmers, as if C++26 is the only version that ever existed.
tourcpp book src appendix-a.md
2.5 kB
Markdown
at main

Appendix A: features and compilers #

This appendix lists the C++ features the book uses. It shows the proposal that introduced or significantly changed each feature. It also shows the compiler support in the pinned toolchain (Clang 22.1.8, libc++). The required flag or header is listed. Finally it indicates whether the book compiles an example or marks it as a gap.

Compiled means the book ships a real example that builds and runs. Gap means the feature is taught prose-first and registered so it builds only with BOOK_ENABLE_GAPS=ON. A "Not yet deployable" callout names the supporting compiler if any.

Feature Proposal Clang 22.1.8 Flag / header Status
std::format / std::print / std::println P0645, P2093 Yes <format>, <print>, -std=c++26 Compiled
std::mdspan P0009 Yes <mdspan> Compiled
std::numbers constants P0631 Yes <numbers> Compiled
Concepts P0734 Yes -std=c++20+ Compiled
consteval, constinit, is_constant_evaluated P1073, P1143, P0595 Yes -std=c++20+ Compiled
Transient constexpr allocation P0784 Yes -std=c++20+ Compiled
Class-type NTTPs P0732 Yes -std=c++20+ Compiled
User-defined literals C++11 Yes -std=c++20+ Compiled
std::generator P2502 Yes <generator> Compiled
std::jthread / stop tokens P0660 Yes <thread>, <stop_token> Compiled
std::atomic_ref P0019 Yes <atomic> Compiled
std::scoped_lock P0156 Yes <mutex> Compiled
std::ranges / views P0896, P2325 Yes <ranges>, <algorithm> Compiled
std::execution::par P0024 No <execution> Prose only
Contracts ([[assert]], [[expects]], [[ensures]]) P2900 No (GCC 16) -fcontracts Gap
std::execution (P2300 senders) P2300 No <execution> Gap
std::linalg P1673 No <linalg> Gap
Static reflection P2996 No (GCC 16 partial) <experimental/meta> Gap
<hazard_pointer> / <rcu> P2530, P2546 No <hazard_pointer>, <rcu> Gap
Modules (import, export module) P1103 Partial -std=c++26, BMI Gap
Lifetime-safety analysis P1179 Experimental -Xclang -fexperimental-lifetime-safety Compiled (demos)

The Nix dev shell in flake.nix provides the pinned toolchain. The book compiles only verified examples. Newer features are taught with exact syntax and an honest callout.