All topics
Interview Preparation
C++ Standards
Headline features across C++11, C++14, C++17, C++20, C++23, and what is on track for C++26.
Sort:
Level:
2 questions
JuniorTheoryVery commonWhat is the C++ standard, and what are the major language versions?
JuniorTheoryVery common
What is the C++ standard, and what are the major language versions?
The C++ standard is the ISO document (ISO/IEC 14882) defining the core language and the standard library. Major versions: C++98, C++11 (auto, lambdas, move), C++14, C++17 (structured bindings, if constexpr), C++20 (concepts, modules, ranges, coroutines), C++23.
Common mistakes
- ✗Conflating compiler version with standard version — GCC 13 supports C++20 mostly, not 'GCC 13 is the C++20 compiler'
- ✗Assuming
-std=c++17enables a strict subset of-std=c++20features — sometimes a feature is dropped/reworked between drafts - ✗Believing a feature lands the year it was proposed — proposals typically take 3–6 years from paper to merged into a standard
Follow-up questions
- →Why are some features marked
[[deprecated]]rather than removed outright? - →Which C++23 features are already usable in mainstream compilers?
MiddleTheoryCommonWhat are the headline features of modern C++ (C++11 through C++23)?
MiddleTheoryCommon
What are the headline features of modern C++ (C++11 through C++23)?
C++11: move semantics, smart pointers, lambdas, auto. C++14: generic lambdas, return-type deduction, relaxed constexpr. C++17: structured bindings, if constexpr, optional, string_view. C++20: concepts, coroutines, modules, ranges, <=>. C++23: std::expected, std::print, mdspan.
Common mistakes
- ✗Assuming C++20 features are production-ready everywhere — modules and coroutines still have rough compiler/build-system support; many teams ship on C++17
- ✗Storing
std::string_viewpast the source string's lifetime — it is a non-owning view, so dangling is UB - ✗Confusing C++11 single-return
constexprwith C++14+ relaxedconstexpr— C++11 forbids local variables and branches inside aconstexprfunction
Follow-up questions
- →What does
std::expected<T, E>(C++23) replace, and how does its cost differ from exceptions? - →Why is build-system support the bottleneck for C++20 modules adoption?