C++20 and C++23 Highlights

C++20 and C++23 Highlights

Key modern language and library features worth adopting in current codebases.

C++20 and C++23 Highlights

C++20 language features

C++20 library features

C++23 highlights

Example: concepts

template <typename T>
concept Incrementable = requires(T x) {
    ++x;
};

Example: std::span

void process(std::span<const int> values);

Adoption advice

Error-handling vocabulary types

std::optional<int> maybe_port;
std::variant<int, std::string> result;
std::expected<std::string, Error> loaded_name;

Modules and coroutines in one glance

export module math;
export int add(int a, int b) { return a + b; }
task<int> compute() {
    co_return 42;
}

Fast wins for real codebases