C++17 — structured bindings, if constexpr, std::optional/variant/any.
C++20 — concepts, ranges, coroutines, modules, format.
C++23 — std::expected, std::print, std::flat_map, std::generator.
1// C++172auto [x, y] = std::pair(1, 2); // Structured binding3if constexpr (sizeof(void*) == 8) { /* ... */ }4std::optional<int> opt = 42;56// C++207template<typename T>8concept Numeric = std::is_arithmetic_v<T>;910auto evens = v | std::views::filter([](int n) { return n % 2 == 0; });1112std::coroutine_handle<> handle;1314std::cout << std::format("{} + {} = {}", 1, 2, 3);1516// C++2317std::expected<int, Error> result = parse(input);1819std::println("Hello {}!", "world");2021std::flat_map<std::string, int> fm;2223std::generator<int> gen() {24 co_yield 1;25}
Key improvements: