Skip to content

Guide · Open source

How to use modern-cpp-features: a C++11 to C++23 cheatsheet

Updated · written with AI from the project's own documentation and checked against our catalogue data

modern-cpp-features is an MIT-licensed reference document on GitHub that lists new language and library features added to C++ in versions 11, 14, 17, 20 and 23, with a short code example for each. It is written for C++ developers catching up on recent changes, students learning modern syntax, and anyone reviewing older code. After this guide you will know how to find a feature, read its example and decide whether it is worth looking up in a fuller reference.

Modern C++ FeaturesAnthonyCalandra/modern-cpp-features · ★ 21.9k · MIT

Quick start

  1. 1Open the README. Go to the AnthonyCalandra/modern-cpp-features repository on GitHub and open the README.
  2. 2Pick a standard version. Choose the C++ version group you want to explore, such as C++11, C++14, C++17, C++20 or C++23.
  3. 3Scan the overview. Look through the Overview list of language and library features for the topic you need.
  4. 4Follow the link. Click the feature name to jump to its section further down the page.
  5. 5Read the example. Read the short description and the code example to see how the syntax is used.
  6. 6Confirm details elsewhere. For exact rules, check a fuller reference such as cppreference.com before using the feature in real code.

What is modern-cpp-features and who is it for?

The project is a cheatsheet of modern C++ language and library features. It is organized as a long README with a table-of-contents-style overview at the top, followed by a section for each feature.

It suits C++ developers catching up on features added since C++11, students learning modern C++ syntax and idioms, and developers reviewing an older codebase who want to see what newer code could look like. It is a quick reference, not the full standard.

  • Good fit: quick lookups of what changed in a standard version
  • Good fit: seeing a short example of how a specific feature is written
  • Not a fit: formal specification details, since the README gives brief summaries and examples rather than the standard text
  • Not a fit: complete beginners, since the examples assume existing C++ knowledge

Open the cheatsheet and get it locally

The project is read online on GitHub. No installation is listed in the source and no prerequisites are named. If you want a local copy, the README gives one optional command to clone the repository.

  • Open https://github.com/AnthonyCalandra/modern-cpp-features in a browser and read the README directly.
  • Optionally clone it to keep a local copy.
git clone https://github.com/AnthonyCalandra/modern-cpp-features

Find a feature using the overview

The README starts with an Overview that groups features by standard version and by kind: language features and library features. Each entry links to its own section further down the page.

To look something up, scan the overview for the feature name, then follow the link. Sections are headed by version, such as C++23 Language Features, so you can also browse everything added in one standard.

  • Use your browser's find command (Ctrl+F or Cmd+F) on the overview for a keyword such as span or optional.
  • Language features and library features are listed separately in each version group.

Read a feature section and its code example

Each feature section has a short description followed by a code example. Read the description first to learn what the feature does, then read the example to see the syntax in use.

Some sections show an old way and a new way side by side. The deducing this section, for example, compares a single templated operator[] with the older pair of const and non-const overloads.

  • Start with the one-line description to confirm you have the right feature.
  • Compare the example with what you currently write to see the difference.
  • Treat the examples as illustrations, not complete programs.
struct T { decltype(auto) operator[](this auto& self, std::size_t idx) { return self.mVector[idx]; } };

Use it alongside authoritative references

The README gives brief summaries rather than formal standard text. When you need exact rules, check a fuller reference. The source names cppreference.com and the C++ Core Guidelines as comparable projects.

A practical workflow is to use the cheatsheet to learn the name and shape of a feature, then confirm details in a reference before relying on them in production code.

  • cppreference.com: broader reference material for the standard library and language
  • C++ Core Guidelines: guidance on writing modern C++

What people use it for

  • Catching up on what C++20 added after learning an older standard
  • Checking the syntax of a feature such as std::span or std::optional before writing code
  • Reviewing an older codebase and looking for newer equivalents, like deducing this replacing paired operator overloads
  • Studying C++23 changes such as the multidimensional subscript operator
  • Teaching students the names and basic forms of modern C++ features

Frequently asked questions

Is modern-cpp-features free to use?

Yes. The project is licensed under the MIT license, as stated in the source. You can read it online at no cost on GitHub.

Do I need to install anything to use modern-cpp-features?

No. The project is read online, and the source lists no prerequisites. Cloning the repository locally is optional.

Is modern-cpp-features a replacement for the C++ standard?

No. It gives brief summaries and examples rather than the formal standard text. For authoritative specification details, use a fuller reference.

Which C++ versions does it cover?

The README covers C++11, C++14, C++17, C++20 and C++23, with separate lists of language and library features for each.

Is modern-cpp-features good for complete beginners?

Not really. The examples assume existing C++ knowledge, so beginners may want to learn the basics first.

What are good alternatives to modern-cpp-features?

The source names cppreference.com and the C++ Core Guidelines as comparable projects. cppreference.com is better for detailed reference, and the Core Guidelines are better for guidance on writing modern C++.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

modern-cpp-features is a good choice for C++ developers and students who want a fast, free overview of what changed in C++11 through C++23, with a short example for each feature. It is less suitable if you need exact specification wording or are new to programming, in which case a fuller reference such as cppreference.com or a structured C++ course will serve you better.

Install options & downloads