Skip to content
UPEEC

Modern C++ Features

What each standard added, and the major C++20/23 features. Lambdas also have their own page earlier in this subject.

Intermediate
Comments 0

This is an overview — pick a sub-topic below.

Sub-topics (10)

C++11

`auto`, range-for, lambdas, move semantics, smart pointers, `nullptr`, `constexpr`, threads, `enum class`, `override`/`final`, variadic templates.

Easy♥ 0🔖 0💬 0

C++14

Generic lambdas, `make_unique`, relaxed constexpr, return type deduction, binary literals, digit separators.

Easy♥ 0🔖 0💬 0

C++17

Structured bindings, `if constexpr`, `optional`/`variant`/`any`, `string_view`, filesystem, fold expressions, inline variables, guaranteed copy elision.

Intermediate♥ 0🔖 0💬 0

C++20

The second big revolution: concepts, ranges, coroutines, modules, `<=>`, `format`, `span`, designated initialisers, `consteval`.

Intermediate♥ 0🔖 0💬 0

C++23

`std::expected`, `std::print`, `std::mdspan`, deducing `this`, `std::generator`, `import std;`, `std::flat_map`.

Intermediate♥ 0🔖 0💬 0

Modules

Replace header inclusion with compiled module interfaces (C++20) — faster builds, no macro leakage.

Advanced♥ 0🔖 0💬 0

Three-Way Comparison

The spaceship operator `<=>` generates all comparisons at once (C++20).

Intermediate♥ 0🔖 0💬 0

Generic Lambdas

Lambdas with `auto` parameters work for any type (C++14); C++20 adds template parameter lists.

Intermediate♥ 0🔖 0💬 0

Contracts

Preconditions, postconditions and assertions as part of function declarations (C++26).

Advanced♥ 0🔖 0💬 0

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.