explaingit

changkun/modern-cpp-tutorial

25,429C++Audience · developerComplexity · 2/5StaleLicenseSetup · easy

TLDR

A practical guide to modern C++ features (C++11 through C++20) for developers familiar with older C++, with code examples and historical context for each feature.

Mindmap

mindmap
  root((repo))
    What it covers
      C++11 features
      C++14 features
      C++17 features
      C++20 features
    Learning approach
      Pick and learn
      Historical context
      Code examples
      Exercises included
    Formats available
      Online reading
      PDF download
      EPUB ebook
      Website version
    Target audience
      Experienced C++ devs
      Intermediate learners
      Language upgraders
    Use cases
      Update legacy skills
      Learn modern idioms
      Quick reference

Things people build with this

USE CASE 1

Update your C++ skills from pre-2011 versions to modern standards without reading a dense reference manual.

USE CASE 2

Learn specific C++17 or C++20 features on demand when you encounter them in a codebase.

USE CASE 3

Understand why modern C++ idioms exist and how they improve safety and expressiveness compared to older patterns.

Tech stack

C++

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

Modern C++ Tutorial is a concise, practical book for developers who already know traditional C++ (the version from around 1998 or earlier) and want to learn the new features added in C++11, C++14, C++17, and C++20. C++ is a powerful but complex programming language widely used in systems software, game engines, and performance-critical applications, and its modern versions added major improvements to make the language safer and more expressive. The book is written "on the fly", meaning it is designed for quick learning, so you can pick a specific feature you need and understand it in isolation rather than reading everything from start to finish. For each feature, it explains not just what it does, but the historical reason it was added, which helps the concepts stick. Each chapter includes code examples and exercises with solutions. You would use this if you are an experienced C++ developer who learned the language before the modern era and wants to update your skills, or if you are an intermediate developer who wants to quickly get up to speed with contemporary C++ idioms (patterns and conventions). The book is available to read online, as a PDF, as an EPUB, and through a website. It exists in both English and Chinese. The tech stack is C++.

Copy-paste prompts

Prompt 1
I know C++98 but haven't touched the language in 15 years. Walk me through the most important changes in C++11 and C++14 that I should know.
Prompt 2
Show me how to use auto type deduction and range-based for loops in modern C++, with before-and-after examples.
Prompt 3
Explain C++17's structured bindings and how they simplify unpacking tuples and pairs in real code.
Prompt 4
I'm seeing lambda functions everywhere in modern C++ codebases. Give me a practical example of when and why to use them instead of function pointers.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.