skip to content

Standard Versions

ISO ships a C++ standard every three years and compilers adopt it piece by piece. Interviewers ask what C++17, 20 and 23 changed and which standard a team should target.

on this pageshow

explore

questions

14

Which ISO C++ standards have been published since C++98, and what headline features did C++11, C++14 and C++17 bring?

level: juniorimportance: must knowfreq 65%

answer

  1. three-year train since 2011
  2. C++03 fixed defects only
  3. C++11: moves, lambdas, smart pointers
  4. C++14 polished, C++17 added vocabulary types

basics

~20 s

C++98 was followed by C++03 (a defect-fix release), then C++11, C++14, C++17, C++20 and C++23 on a three-year train. C++11 added move semantics, auto, lambdas and smart pointers; C++14 polished them; C++17 added optional, variant, string_view and structured bindings.

solid answer

~40 s

The published revisions are C++98, C++03 (a technical corrigendum with no headline features), C++11, C++14, C++17, C++20 and C++23, which ISO published in 2024; WG21 finished C++26 in 2026. Since C++11 the committee ships on a **three-year train**: what is ready ships, the rest waits. **C++11** is the rewrite people call modern C++: rvalue references and move semantics, `auto`, lambdas, range-`for`, `nullptr`, `constexpr`, variadic templates, `std::unique_ptr` and `std::shared_ptr`, `std::thread` and a memory model. **C++14** finished it: generic lambdas, function return type deduction, `std::make_unique`. **C++17** added `std::optional`, `std::variant`, `std::string_view`, `std::filesystem`, structured bindings, `if constexpr`, fold expressions and guaranteed copy elision, and removed `std::auto_ptr`.

go deeper

for a junior

Recall the order C++98, C++11, C++14, C++17, C++20, C++23 and three headline features of C++11; naming move semantics, lambdas and smart pointers is the usual screen.

for a middle

Place features precisely: generic lambdas and make_unique are C++14, optional and structured bindings C++17. Explain why the three-year train makes small releases like C++14 normal.

for a senior

Connect the timeline to code you maintained: which removals bit you when raising the standard, and which C++17 features replaced in-house utilities or third-party optional and variant types.

for a principal

Treat the revision list as a dependency on toolchains: a standard's year says what the document contains, not what your oldest compiler or standard library already ships.

## The release train C++ is standardised by the ISO committee **WG21**. Each published revision replaces the previous one as *the* C++ standard, and compilers then implement it over several releases. C++98 to C++11 took thirteen years; since C++11 the committee has run a **three-year train**: whatever is finished when the train leaves ships, and a feature that is not ready waits for the next one. That is how C++20's coroutines could ship without a library generator type, with `std::generator` following in C++23. | Revision | `__cplusplus` | Character | |---|---|---| | C++98 | `199711L` | first ISO standard | | C++03 | `199711L` | technical corrigendum: defect fixes, no new headline features | | C++11 | `201103L` | the large rewrite usually called modern C++ | | C++14 | `201402L` | completes C++11 | | C++17 | `201703L` | vocabulary types and template conveniences | | C++20 | `202002L` | concepts, ranges, coroutines, modules | | C++23 | `202302L` | completes C++20; published by ISO in 2024 | | C++26 | `202603L` in the final draft | finished by WG21 in 2026, ISO publication pending | Before a revision's year was known, compilers used provisional flag spellings: `c++0x` for C++11, `c++1y` for C++14, `c++1z` for C++17, `c++2a` for C++20, `c++2b` for C++23 and `c++2c` for C++26. GCC still accepts the old ones and documents them as deprecated, so you will meet `-std=c++1z` in old build files. ## C++11: the release that defined modern C++ C++11 changed how everyday code is written. The features an interviewer expects you to name: - **Rvalue references and move semantics** — containers and strings can hand over their buffers instead of copying them. - **`auto` and `decltype`** — the compiler deduces types. - **Lambdas** and the **range-based `for`** loop. - **`nullptr`**, **`enum class`**, `override` and `final`, `= default` and `= delete`. - **`constexpr`** functions (one return statement only in C++11), **variadic templates** and `static_assert`. - **Smart pointers** `std::unique_ptr` and `std::shared_ptr`, plus the hash containers `std::unordered_map` and `std::unordered_set`. - **`std::thread`, `std::mutex`, `std::atomic`** and a memory model, so threads became part of the language rather than a platform API. ## C++14: finishing C++11 C++14 is a small release that fills the gaps C++11 left: **generic lambdas** (`auto` parameters), **return type deduction** for ordinary functions, **init captures** in lambdas, relaxed `constexpr` (loops and several statements), **variable templates**, binary literals and digit separators (`1'000'000`), and **`std::make_unique`**, which C++11 had left out. ## C++17: vocabulary types and simpler templates C++17 is the baseline most production code builds with today. It brought: - library **vocabulary types**: `std::optional`, `std::variant`, `std::any`, `std::string_view`, plus `std::filesystem` and the parallel algorithms in `<execution>`; - **structured bindings** (`auto [key, value] = pair;`), **`if constexpr`**, **fold expressions** and **class template argument deduction**; - **inline variables**, nested namespace definitions (`namespace a::b {}`) and `if` statements with an initializer; - **guaranteed copy elision** for prvalues and a defined evaluation order for several expressions; - **removals**: `std::auto_ptr`, `std::bind1st`/`bind2nd`, `std::random_shuffle`, the `register` storage class, trigraphs and potentially-throwing dynamic exception specifications such as `throw(std::bad_alloc)`. ## Reading the timeline in an interview A good answer does three things: 1. **Ties each headline to its revision.** "Lambdas are C++11, generic lambdas C++14" shows you have lived through the versions; "lambdas are C++14" is the classic slip. 2. **Knows what was removed**, because removals are what break old code when a team raises its standard: `auto_ptr` code stops compiling under `-std=c++17`. 3. **Separates the standard from the compiler.** A revision is a document; each compiler ships it feature by feature, so "C++17" in a job description means the language mode a team builds with, not a promise that every feature works on every toolchain. ## Where the later revisions fit The same train continued after C++17. **C++20** was the next large release, comparable in scope to C++11: concepts, ranges, coroutines and modules, plus `<=>`, `std::format`, `std::span` and `std::jthread`. **C++23** is a completing release in the spirit of C++14 — `std::expected`, `std::print`, `std::generator` and deducing `this` fill gaps C++20 left — and ISO published it in 2024 as ISO/IEC 14882:2024. **C++26**, finished by WG21 in 2026, adds static reflection, contracts and `std::execution`. In an interview you only need to place these releases on the timeline; each one's features are a topic of their own. One pattern is worth saying out loud because interviewers like it: the large releases (C++11, C++20) are each followed by a smaller one (C++14, C++23) that completes them. The train makes this natural, since a feature that misses the deadline simply arrives three years later.

  • What do flag spellings such as -std=c++1z or -std=c++2b mean?
    They are the provisional names compilers used before a revision's year was fixed: `c++0x` is C++11, `c++1y` C++14, `c++1z` C++17, `c++2a` C++20, `c++2b` C++23 and `c++2c` C++26. GCC still accepts the older ones and documents them as deprecated, so a build file using `-std=c++1z` is simply asking for C++17.
  • What did C++17 remove that older code may still use?
    `std::auto_ptr` (use `std::unique_ptr`), `std::bind1st`, `bind2nd` and `std::random_shuffle`, the `register` storage class, trigraphs, `++` on a `bool`, and potentially-throwing dynamic exception specifications such as `throw(X)`. The empty `throw()` survived as a non-throwing specification until C++20 removed it in favour of `noexcept`.

  • Lambdas and auto were introduced in C++14.
  • C++03 was a feature release on the scale of C++11.
  • std::make_unique arrived together with std::unique_ptr in C++11.
  • std::optional and std::string_view have been standard since C++11.
  • WG21 publishes a new standard only when a big feature is ready.

Assumes C++23 (ISO/IEC 14882:2024) is the latest published standard; C++26 is finished by WG21 but awaits ISO publication.

open as a page

What are C++20's four headline features — concepts, ranges, coroutines and modules — and what problem does each solve?

level: middleimportance: must knowfreq 65%

basics

~10 s

Concepts state template requirements so misuse fails at the call; ranges let algorithms take whole ranges and compose lazy views; coroutines let a function suspend and resume; modules replace textual #include with compiled interfaces.

open as a page

What does the GCC or Clang flag -std=c++17 select, and how does it differ from -std=gnu++17 and from passing no flag?

level: juniorimportance: should knowfreq 50%

basics

~20 s

-std=c++17 compiles the translation unit as ISO C++17, setting __cplusplus to 201703L and disabling GNU extensions that conflict with it. -std=gnu++17 is C++17 plus all GNU extensions. With no flag, each compiler uses its own default mode.

open as a page

Besides the big four, which smaller C++20 additions — <=>, std::format, std::span and std::jthread — would you cite, and what did each replace?

level: juniorimportance: should knowfreq 55%

basics

~10 s

A defaulted operator<=> generates all comparisons; std::format replaces printf and stream manipulators with type-safe {} formatting; std::span replaces pointer-and-length parameters; std::jthread replaces std::thread and joins automatically after requesting stop.

open as a page

Why can a C++ toolchain building with -std=c++20 still reject correct C++20 code, and how do you find out what it really supports?

level: middleimportance: should knowfreq 45%

basics

~20 s

-std=c++20 selects the language mode; it does not promise that the compiler and its standard library implement all of C++20. Vendors ship a revision paper by paper, some features stay behind extra flags, and the compiler and library are separate projects. Status pages and a build on every toolchain tell you what works.

open as a page

Which C++23 additions — std::print, std::generator, import std, std::mdspan and std::flat_map — complete what C++20 started, and how?

level: middleimportance: should knowfreq 40%

basics

~20 s

C++23 fills gaps C++20 left: std::print writes std::format output directly, std::generator gives coroutines a standard lazy sequence, import std makes the library importable as a module, std::mdspan adds multidimensional views, and std::flat_map offers a contiguous sorted map.

open as a page

What do C++26's erroneous behaviour and hardened standard library change about reading uninitialized locals and out-of-bounds indexing?

level: middleimportance: should knowfreq 30%

basics

~20 s

In C++26, reading an uninitialized local is erroneous behaviour: well-defined but wrong, using an implementation-chosen value the tool may diagnose. A hardened library checks preconditions such as vector::operator[]'s index and terminates through a contract violation instead of undefined behaviour.

open as a page

When a C++17 codebase is rebuilt with -std=c++20, which language and library changes most often stop it compiling, and how do you fix them?

level: seniorimportance: should knowfreq 40%

basics

~20 s

The usual breaks are new keywords (concept, requires, char8_t, co_await), u8 literals becoming char8_t, classes with user-declared constructors losing aggregate status, reversed operator== candidates, and removed library names such as std::result_of. Fix each mode-neutrally, then rebuild dependencies.

open as a page

In a C++23 modernization, what do std::expected and deducing this each replace, and when would you reach for them?

level: seniorimportance: should knowfreq 45%

basics

~20 s

std::expected<T, E> returns either a value or a typed error, replacing error codes with out-parameters and ad hoc result structs where failure is normal. Deducing this makes the object an explicit parameter, replacing duplicated const and non-const overloads and much CRTP boilerplate.

open as a page

How do C++26 contracts — pre, post and contract_assert — work, and what do the ignore, observe, enforce and quick-enforce semantics do?

level: seniorimportance: should knowfreq 25%

basics

~20 s

pre and post attach preconditions and postconditions to a function declaration, and contract_assert checks inside a body. Each evaluation uses an implementation-chosen semantic: ignore skips it, observe calls the violation handler and continues, enforce calls it then terminates, quick-enforce terminates at once.

open as a page

How do you decide whether a C++ codebase built by MSVC, GCC and Clang for three platforms should move from C++17 to C++20, and how do you roll it out?

level: principalimportance: should knowfreq 40%

basics

~20 s

The baseline is capped by the oldest compiler and standard library each platform must keep. Build a per-feature support matrix, weigh the features you want against migration cost and dependency rebuilds, then roll out with a parallel C++20 CI job before flipping.

open as a page

What are C++26's headline features, and what is its standardisation and compiler-support status in 2026?

level: juniorimportance: nice to knowfreq 30%

basics

~20 s

C++26 adds static reflection, contracts and the std::execution async model, plus erroneous behaviour, a hardened library, #embed, pack indexing and std::inplace_vector. WG21 finished it in 2026; ISO publication is pending and compiler support is partial.

open as a page

How does C++26 static reflection work — the ^^ operator, std::meta::info and splicing — and what can a team build with it?

level: seniorimportance: nice to knowfreq 25%

basics

~20 s

The ^^ operator turns a type, member or other entity into a std::meta::info value at compile time; consteval functions in <meta> query it, and a splice [: r :] turns a reflection back into code. Nothing exists at run time unless you generate it.

open as a page

What model does C++26's std::execution introduce — senders, receivers and schedulers — and what problems does it address?

level: seniorimportance: nice to knowfreq 25%

basics

~20 s

std::execution describes asynchronous work as senders: lazy objects that, once connected to a receiver and started, complete through set_value, set_error or set_stopped. Schedulers say where work runs; then, let_value and when_all compose senders; sync_wait blocks for the result.

open as a page