C++
C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, or “C with Classes”. It is widely used for system/software development, game development, drivers, client-server applications, and embedded firmware.
Versions
C++98
- First standardized version of C++.
- Introduced the Standard Template Library (STL).
- Added exceptions, RTTI, and namespaces.
- Standardized templates and operator overloading.
C++03
- Bug-fix and clarification release for C++98.
- Improved template handling, value initialization, and standard library conformance.
- Introduced small but notable additions like
std::ios_base::failureand betterexportsemantics.
C++11
- Major modernization.
- Core features:
auto, range-based for loops,nullptr, lambdas.- rvalue references and move semantics.
constexpr,static_assert,enum class.
- Library additions:
- Smart pointers, unordered containers, threading library,
regex,chrono, tuples.
- Smart pointers, unordered containers, threading library,
C++14
- Refinement of C++11; small usability upgrades.
- Features:
- Generic lambdas, return type deduction, binary literals.
- Relaxed
constexprrules and small library improvements (std::make_unique).
C++17
- Consolidation and cleanup of C++11/14 with new high-level utilities.
- Core features:
- Structured bindings,
if constexpr, fold expressions, inline variables. - Class template argument deduction (CTAD), guaranteed copy elision.
- Structured bindings,
- Library additions:
std::optional,std::variant,std::any.std::string_view,std::filesystem, and parallel algorithms.- New utilities in
<memory_resource>and<execution>.
C++20
- A major leap forward introducing concepts, modules, and coroutines.
- Core features:
- Concepts for constraining templates.
- Modules as a faster, cleaner alternative to headers.
- Coroutines (
co_await,co_yield,co_return) for async programming. - Three-way comparison operator (
<=>or “spaceship operator”). consteval,constinit, and more powerfulconstexprfunctions.
- Library additions:
std::span,std::ranges,std::format,std::source_location.- Calendar and timezone support in
<chrono>. std::jthread,std::stop_token, and synchronization primitives.- Concepts-based ranges library and the
viewsframework.
C++23
- Incremental but meaningful refinement of C++20.
- Core features:
- Deduction guides for more containers and aggregates.
if consteval,explicitforoperator(), and more constexpr expansions.constexprdynamic allocation (heap operations now allowed in constexpr).- Improved pattern matching groundwork via
std::visitextensions.
- Library additions:
std::expected(error handling without exceptions).std::print/std::println(fast I/O usingstd::formatbackend).std::flat_map/std::flat_set(cache-friendly associative containers).std::move_only_functionas a lightweight, move-only callable wrapper.- Expanded ranges algorithms and string views.
- Standardized stacktrace support (
std::stacktrace).