Skip to content

C++ Feature Cheat Sheet ​

A structured quick-reference index covering all major features from C++98 through C++23. Features that already have a cheat sheet are directly clickable, leading to core API signatures, minimal compilable examples, embedded applicability, and compiler support information. Features without a cheat sheet yet are listed as plain text and will be filled in by later batches.

Need to quickly look up the syntax of some feature? Come here. Want to learn it systematically? Go read the tutorial articles in the corresponding volume.

Quick Navigation ​

By standard version:C++98/03 | C++11 | C++14 | C++17 | C++20 | C++23 | C++26

By functional category:Memory Management | Containers and Views | Concurrency | Core Language Features | Templates and Metaprogramming

Legend

  • Applicability: High = strongly recommended for embedded use, Medium = choose by scenario, Low = usually not needed
  • Blue links = a cheat sheet already exists, plain text = cheat sheet pending
  • "Language feature" in the Header column means a core language mechanism that requires no #include

By Standard Version ​

C++98/03 ​

C++98 (ISO/IEC 14882:1998) was the first ISO-standardized version. It laid down the core machinery — the three STL pillars of containers, algorithms, and iterators, plus exception handling, namespaces, and templates — and these mechanisms still form the daily infrastructure of C++ programming today. C++03 was a bug-fix release: it only clarified details such as value-initialization semantics, with no major new features.

FeatureHeaderSummaryApplicability
STL containers (vector, list, deque, map, set...)<vector> etc.Sequential/associative/unordered container familiesHigh
STL algorithms (sort, find, transform...)<algorithm>Sorting/searching/transformation and other generic algorithmsHigh
STL iterators<iterator>Unified traversal interfaceHigh
std::string<string>Variable-length stringHigh
iostream<iostream>Type-safe I/O streamsMedium
RAII (construction/destruction/copy semantics)Language featureResource acquisition is initializationHigh
Exception handling (try/catch/throw)Language featureStructured error handlingMedium
Namespaces (namespace)Language featurePrevents name collisionsHigh
Class templates / function templatesLanguage featureFoundation of generic programmingHigh
Operator overloadingLanguage featureCustom operator behavior for user typesMedium
Function objects (functors)<functional>Callable objects and adaptorsMedium
RTTI (dynamic_cast, typeid)<typeinfo>Run-time type identificationLow
std::complex / std::valarray<complex>Numeric computation supportLow

C++11 ​

C++11 is where modern C++ begins: it brought revolutionary features such as lambdas, auto, move semantics, smart pointers, and the concurrency support library. From this version on, C++ evolved from "C with classes" into a truly efficient abstraction language — this is the first stop for learning Modern C++.

FeatureHeaderSummaryApplicability
std::unique_ptr<memory>Smart pointer with exclusive ownershipHigh
std::shared_ptr<memory>Smart pointer with shared ownershipMedium
std::weak_ptr<memory>Breaks shared_ptr reference cyclesMedium
Lambda expressionsLanguage featureAnonymous function objectsHigh
autoLanguage featureAutomatic type deductionHigh
decltypeLanguage featureQueries the type of an expressionHigh
constexprLanguage featureCompile-time constants and functionsHigh
Range-based for (range-for)Language featureSyntactic sugar for container traversalHigh
Move semantics (rvalue references)Language featureTransfers resources instead of copyingHigh
std::move / std::forward<utility>Utilities for moving and perfect forwardingHigh
nullptrLanguage featureType-safe null pointer constantHigh
enum classLanguage featureScoped, strongly typed enumerationsHigh
override / finalLanguage featureExplicit marking of virtual overridesHigh
static_assertLanguage featureCompile-time assertionsHigh
Variadic templatesLanguage featureAny number of template parametersHigh
std::initializer_list<initializer_list>Uniform initializer listsHigh
std::array<array>Compile-time fixed-size arrayHigh
std::tuple<tuple>Heterogeneous fixed-size containerMedium
std::unordered_map / set<unordered_map>Hash-table containersMedium
std::function<functional>Polymorphic function wrapperMedium
User-defined literalsLanguage featureCustom literal suffixesMedium
Delegating / inheriting constructorsLanguage featureConstructor reuseMedium
alignas / alignofLanguage featureAlignment control and queryMedium
std::thread<thread>Platform-independent threadsHigh
std::mutex / lock_guard<mutex>Mutexes and RAII lockingHigh
std::atomic<atomic>Lock-free atomic operationsHigh
std::condition_variable<condition_variable>Condition-variable synchronizationMedium
std::future / async<future>Asynchronous tasks and result retrievalMedium
std::chrono<chrono>Time libraryHigh

C++14 ​

C++14 polished and rounded off C++11 — it relaxed the constexpr restrictions and introduced generic lambdas and std::make_unique. The changes are modest but practical, and almost every one of them can be used directly in embedded development.

FeatureHeaderSummaryApplicability
std::make_unique<memory>Exception-safe creation of unique_ptrHigh
Generic lambdasLanguage featureauto parameters in lambdasHigh
Return type deduction (auto return)Language featureauto deduction of function return valuesMedium
Relaxed constexprLanguage featureRelaxed constexpr restrictions (loops/local variables)High
decltype(auto)Language featureReturn type deduction for perfect forwardingMedium
std::exchange<utility>Replaces a value and returns the old oneMedium
std::integer_sequence<utility>Compile-time integer sequencesMedium
Binary literals (0b)Language featureBinary integers with the 0b prefixMedium
Digit separators (')Language featureApostrophe separators improve numeric readabilityLow
std::shared_timed_mutex<shared_mutex>Timed shared mutexLow

C++17 ​

C++17 brought high-frequency features such as structured bindings, if constexpr, string_view, optional, and variant, markedly boosting the expressiveness of everyday coding. CTAD and guaranteed copy elision removed piles of boilerplate, and std::filesystem filled the long-standing gap in file operations.

FeatureHeaderSummaryApplicability
std::optional<optional>Optional-value wrapperHigh
std::variant<variant>Type-safe unionMedium
std::string_view<string_view>Zero-copy string viewHigh
std::any<any>Type-safe container for any valueLow
std::filesystem<filesystem>Filesystem operationsMedium
Structured bindingsLanguage featureDestructuring multiple return valuesHigh
if constexprLanguage featureCompile-time conditional branchesHigh
Fold expressionsLanguage featureOperations over expanded parameter packsHigh
CTADLanguage featureClass template argument deductionHigh
Guaranteed copy elisionLanguage featureMandated elision of temporary copiesHigh
std::invoke<functional>Unified invocation interfaceMedium
std::apply<tuple>Expands a tuple into function argumentsMedium
Inline variablesLanguage featureDefine global variables in headersMedium
std::byte<cstddef>Standalone byte typeMedium
std::pmr memory resources<memory_resource>Memory resources for polymorphic allocatorsMedium
std::shared_mutex<shared_mutex>Reader-writer lockMedium
Nested namespaces (A::B::C)Language featureNamespace shorthandLow
if/switch init statementsLanguage featureDeclare variables inside conditionalsMedium

C++20 ​

C++20 is the biggest update since C++11: the four headline features — Concepts, Ranges, Coroutines, and Modules — thoroughly changed how we do template programming, data pipelines, asynchronous flows, and code organization. On top of that, features like std::format, std::span, and three-way comparison noticeably improved day-to-day development. Compiler support requirements are relatively high (GCC 10+ / Clang 10+).

FeatureHeaderSummaryApplicability
Concepts<concepts>Compile-time constraints on template parametersHigh
Ranges<ranges>Composable ranges and viewsHigh
std::span<span>Non-owning view of contiguous sequencesHigh
std::format<format>Type-safe formatted outputHigh
std::jthread<thread>Thread class that joins automaticallyHigh
Three-way comparison (<=>)<compare>Unified comparison operatorsHigh
Coroutines<coroutine>Stackless coroutinesHigh
ModulesLanguage featureCompilation units replacing headersHigh
constevalLanguage featureForces compile-time evaluationMedium
constinitLanguage featureCompile-time initialization of static variablesMedium
std::source_location<source_location>Compile-time source location informationMedium
Designated initializersLanguage featureInitialize aggregates by member nameMedium
std::atomic_ref<atomic>Atomic operations through referencesMedium
std::latch / barrier<latch>Thread synchronization primitivesMedium
std::stop_token<stop_token>Cooperative thread cancellationMedium
std::erase / erase_if<vector> etc.Unified interface for erasing container elementsMedium
std::is_constant_evaluated<type_traits>Detects constant-evaluation contextsMedium
range-for init statementsLanguage featurerange-for with an initializerLow

C++23 ​

C++23 polished C++20 and filled in its gaps: practical library components such as std::expected, std::print, std::generator, and std::flat_map closed key blanks, and language improvements like deducing this slimmed down how member functions are written. Compiler support for some features is still in progress (GCC 14+ / Clang 18+).

FeatureHeaderSummaryApplicability
std::expected<expected>Wrapper type for error handlingMedium
std::print / println<print>Formatted output to stdoutHigh
std::generator<generator>Synchronous coroutine generatorMedium
std::flat_map / flat_set<flat_map>Ordered containers backed by contiguous storageMedium
std::mdspan<mdspan>Non-owning view of multidimensional arraysMedium
std::stacktrace<stacktrace>Capture and print the call stackMedium
deducing thisLanguage featureExplicit object parameter deductionMedium
std::to_underlying<utility>Converts an enum to its underlying typeMedium
std::out_ptr / inout_ptr<memory>Smart pointer interop with C pointersMedium
optional monadic operations<optional>and_then / or_else / transformMedium
New Ranges adaptors<ranges>zip / chunk / slide / enumerate, etc.Medium
if constevalLanguage featureConditional check for constant evaluationLow
std::unreachable<utility>Marks unreachable codeLow
Multidimensional subscript operatorLanguage featureoperator[] accepts multiple argumentsLow
std::is_scoped_enum<type_traits>Detects scoped enumeration typesLow

C++26 ​

C++26 is the next standard, currently under development (ISO/IEC 14882:2026). As of mid-2026, most features are still at the working-draft stage, with preliminary or only partial compiler support, and their final inclusion and wording may still change. Only high-certainty directions are listed here; for compiler support, defer to the up-to-date cppreference table.

FeatureHeaderSummaryApplicability
Reflection (static reflection)<meta> (draft)Compile-time type introspection and generation, the C++26 flagship featureMedium
Contracts<contracts> (draft)precondition/postcondition/assert runtime contract checksMedium
std::execution / Senders<execution> (draft)scheduler/sender/receiver asynchronous task graphs (P2300)Medium
std::linalg<linalg>BLAS-based linear algebra free functionsMedium
std::text_encoding<text_encoding>Detects the runtime text encodingLow
Hazard pointers / RCU<hazard_pointer> <rcu>Lock-free concurrency primitivesLow

C++26 is still a draft

Compiler support for the features above is uneven: GCC 16 has partial implementations of reflection, contracts, and linalg; none of the three major standard libraries ships a usable std::execution yet (you have to run NVIDIA/stdexec for that); most of the rest are still experimental. Do not rely on it in production, but studying it for a preview is fine. See the cppreference C++26 compiler support table.

By Functional Category ​

Memory Management ​

Memory- and resource-management features such as smart pointers, optional values, and error handling. See the Memory Management cheat sheet for details.

FeatureVersionHeaderSummaryApplicability
std::unique_ptrC++11<memory>Smart pointer with exclusive ownershipHigh
std::shared_ptrC++11<memory>Smart pointer with shared ownershipMedium
std::weak_ptrC++11<memory>Breaks shared_ptr reference cyclesMedium
std::make_uniqueC++14<memory>Exception-safe creation of unique_ptrHigh
std::optionalC++17<optional>Optional-value wrapperHigh
std::pmr memory resourcesC++17<memory_resource>Memory resources for polymorphic allocatorsMedium
std::expectedC++23<expected>Wrapper type for error handlingMedium
std::out_ptr / inout_ptrC++23<memory>Smart pointer interop with C pointersMedium
optional monadic operationsC++23<optional>and_then / or_else / transformMedium
Cheat sheets still pending

Cheat sheets have not been created yet for: std::weak_ptr, std::pmr memory resources, std::out_ptr / inout_ptr, optional monadic operations

Containers and Views ​

Features for organizing and manipulating data: standard containers, views, strings, formatting, algorithms, and more. See the Containers and Views cheat sheet for details.

FeatureVersionHeaderSummaryApplicability
STL containers (vector, list, deque, map, set...)C++98<vector> etc.Sequential/associative/unordered container familiesHigh
STL algorithmsC++98<algorithm>Sorting/searching/transformation and other generic algorithmsHigh
std::stringC++98<string>Variable-length stringHigh
std::arrayC++11<array>Compile-time fixed-size arrayHigh
std::tupleC++11<tuple>Heterogeneous fixed-size containerMedium
std::unordered_map / setC++11<unordered_map>Hash-table containersMedium
std::functionC++11<functional>Polymorphic function wrapperMedium
std::string_viewC++17<string_view>Zero-copy string viewHigh
std::variantC++17<variant>Type-safe unionMedium
std::anyC++17<any>Type-safe container for any valueLow
std::filesystemC++17<filesystem>Filesystem operationsMedium
RangesC++20<ranges>Composable ranges and viewsHigh
std::spanC++20<span>Non-owning view of contiguous sequencesHigh
std::formatC++20<format>Type-safe formatted outputHigh
std::erase / erase_ifC++20<vector> etc.Unified interface for erasing container elementsMedium
std::flat_map / flat_setC++23<flat_map>Ordered containers backed by contiguous storageMedium
std::generatorC++23<generator>Synchronous coroutine generatorMedium
std::print / printlnC++23<print>Formatted output to stdoutHigh
std::mdspanC++23<mdspan>Non-owning view of multidimensional arraysMedium
New Ranges adaptorsC++23<ranges>zip / chunk / slide / enumerate, etc.Medium
Cheat sheets still pending

Cheat sheets have not been created yet for: STL containers, STL algorithms, std::string, std::tuple, std::unordered_map/set, std::function, std::any, Ranges, std::erase/erase_if, new Ranges adaptors

Concurrency ​

Concurrency and multithreading features: threads, locks, atomic operations, synchronization primitives, and more. See the Concurrency cheat sheet for details.

FeatureVersionHeaderSummaryApplicability
std::threadC++11<thread>Platform-independent threadsHigh
std::mutex / lock_guardC++11<mutex>Mutexes and RAII lockingHigh
std::atomicC++11<atomic>Lock-free atomic operationsHigh
std::condition_variableC++11<condition_variable>Condition-variable synchronizationMedium
std::future / asyncC++11<future>Asynchronous tasks and result retrievalMedium
std::chronoC++11<chrono>Time libraryHigh
std::shared_timed_mutexC++14<shared_mutex>Timed shared mutexLow
std::shared_mutexC++17<shared_mutex>Reader-writer lockMedium
std::jthreadC++20<thread>Thread class that joins automaticallyHigh
std::atomic_refC++20<atomic>Atomic operations through referencesMedium
std::latch / barrierC++20<latch>Thread synchronization primitivesMedium
std::stop_tokenC++20<stop_token>Cooperative thread cancellationMedium
Cheat sheets still pending

Cheat sheets have not been created yet for: std::condition_variable, std::future / async, std::chrono, std::shared_timed_mutex, std::shared_mutex, std::atomic_ref, std::latch / barrier, std::stop_token

Core Language Features ​

Core language features: keywords, syntactic sugar, the type system, compile-time mechanisms, and more. See the Core Language Features cheat sheet for details.

FeatureVersionHeaderSummaryApplicability
RAII (construction/destruction/copy)C++98Language featureResource acquisition is initializationHigh
Exception handlingC++98Language featureStructured error handlingMedium
NamespacesC++98Language featurePrevents name collisionsHigh
Operator overloadingC++98Language featureCustom operator behavior for user typesMedium
iostreamC++98<iostream>Type-safe I/O streamsMedium
Lambda expressionsC++11Language featureAnonymous function objectsHigh
autoC++11Language featureAutomatic type deductionHigh
decltypeC++11Language featureQueries the type of an expressionHigh
constexprC++11Language featureCompile-time constants and functionsHigh
Range-based forC++11Language featureSyntactic sugar for container traversalHigh
Move semantics (rvalue references)C++11Language featureTransfers resources instead of copyingHigh
std::move / std::forwardC++11<utility>Utilities for moving and perfect forwardingHigh
nullptrC++11Language featureType-safe null pointer constantHigh
enum classC++11Language featureScoped, strongly typed enumerationsHigh
override / finalC++11Language featureExplicit marking of virtual overridesHigh
static_assertC++11Language featureCompile-time assertionsHigh
User-defined literalsC++11Language featureCustom literal suffixesMedium
Delegating / inheriting constructorsC++11Language featureConstructor reuseMedium
alignas / alignofC++11Language featureAlignment control and queryMedium
Generic lambdasC++14Language featureauto parameters in lambdasHigh
Return type deductionC++14Language featureauto deduction of function return valuesMedium
Relaxed constexprC++14Language featureRelaxed constexpr restrictionsHigh
decltype(auto)C++14Language featureReturn type deduction for perfect forwardingMedium
Binary literalsC++14Language featureBinary integers with the 0b prefixMedium
Structured bindingsC++17Language featureDestructuring multiple return valuesHigh
if constexprC++17Language featureCompile-time conditional branchesHigh
CTADC++17Language featureClass template argument deductionHigh
Guaranteed copy elisionC++17Language featureMandated elision of temporary copiesHigh
Inline variablesC++17Language featureDefine global variables in headersMedium
std::byteC++17<cstddef>Standalone byte typeMedium
Nested namespacesC++17Language featureA::B::C shorthandLow
if/switch init statementsC++17Language featureDeclare variables inside conditionalsMedium
Three-way comparison (<=>)C++20<compare>Unified comparison operatorsHigh
CoroutinesC++20<coroutine>Stackless coroutinesHigh
ModulesC++20Language featureCompilation units replacing headersHigh
constevalC++20Language featureForces compile-time evaluationMedium
constinitC++20Language featureCompile-time initialization of static variablesMedium
std::source_locationC++20<source_location>Compile-time source locationMedium
Designated initializersC++20Language featureInitialize aggregates by member nameMedium
deducing thisC++23Language featureExplicit object parameter deductionMedium
std::to_underlyingC++23<utility>Converts an enum to its underlying typeMedium
std::unreachableC++23<utility>Marks unreachable codeLow
if constevalC++23Language featureConditional check for constant evaluationLow
Multidimensional subscript operatorC++23Language featureoperator[] with multiple argumentsLow
std::stacktraceC++23<stacktrace>Capture and print the call stackMedium
Cheat sheets still pending

Cheat sheets have not been created yet for: move semantics, static_assert, user-defined literals, delegating/inheriting constructors, alignas / alignof, return type deduction, relaxed constexpr, decltype(auto), binary literals, CTAD, guaranteed copy elision, std::byte, if/switch init statements, consteval, constinit, std::source_location, designated initializers, std::to_underlying, std::unreachable, if consteval, multidimensional subscript operator

Templates and Metaprogramming ​

Generic programming and metaprogramming features: templates, constraints, type traits, compile-time computation, and more. See the Templates and Metaprogramming cheat sheet for details.

FeatureVersionHeaderSummaryApplicability
Class templates / function templatesC++98Language featureFoundation of generic programmingHigh
Variadic templatesC++11Language featureAny number of template parametersHigh
std::initializer_listC++11<initializer_list>Uniform initializer listsHigh
std::integer_sequenceC++14<utility>Compile-time integer sequencesMedium
Fold expressionsC++17Language featureOperations over expanded parameter packsHigh
std::invokeC++17<functional>Unified invocation interfaceMedium
std::applyC++17<tuple>Expands a tuple into function argumentsMedium
ConceptsC++20<concepts>Compile-time constraints on template parametersHigh
std::is_constant_evaluatedC++20<type_traits>Detects constant-evaluation contextsMedium
std::is_scoped_enumC++23<type_traits>Detects scoped enumeration typesLow
Cheat sheets still pending

Cheat sheets have not been created yet for: std::integer_sequence, std::invoke, std::apply, std::is_constant_evaluated, std::is_scoped_enum


Some content is referenced from cppreference.com, used under the CC-BY-SA 4.0 license

pdf-latest-4-g85128cc · 85128cc · 2026-10-05