C++ Standards (C++11 to C++23)
Evolution of C++ language standards
C++ Standards Evolution
Modern C++ is vastly different from pre-2011 C++. The ISO C++ committee releases a new standard mathematically every three years, consistently introducing powerful zero-cost abstractions and modernizing the standard library capabilities.
auto type inference, Lambdas, Move Semantics (rvalue references), Smart Pointers (std::unique_ptr), and threaded memory models.
Generic lambdas (using auto parameters), return type deduction, binary literals (0b1010), and digit separators (1'000'000).
Structured bindings (auto [x,y] = func()), std::optional, std::variant, std::any, if constexpr, and std::filesystem.
Concepts (template constraints), Modules (replacing #include), Coroutines (async execution), Ranges library, and Spaceship operator (<=>).
std::print (finally replacing pure cout), deducing this, multidimensional subscript operators, and extensive constexpr support.
Code Examples
Examples of features from different C++ standards.
1// C++11: auto and range-for
2auto vec = std::vector<int>{1, 2, 3};
3for (const auto& val : vec) { }
4
5// C++17: structured bindings
6auto [x, y] = std::make_pair(1, 2);
7
8// C++20: concepts
9template<std::integral T>
10T add(T a, T b) { return a + b; }