std::flat_map in C++
If you have ever reached for std::map and wondered why iterating over it feels slower than it should, or why your cache profiler lights up red — std::flat_map is the answer C++23 gives you. This post
Search for a command to run...
Series
Crack open every major feature of C++23 with real-world examples and hands-on code. Each post dives deep into one feature — what it is, why it exists, and how to use it effectively in production code.
If you have ever reached for std::map and wondered why iterating over it feels slower than it should, or why your cache profiler lights up red — std::flat_map is the answer C++23 gives you. This post
If you have been writing C++ for a while, you already know how much the language has evolved — from the raw, manual world of C++98 to the expressive power of C++11, the refinements of C++17, and the b
Before you write a single line of C++23 code, you need a development environment that actually supports it. This sounds simple — but in practice, C++23 support is spread unevenly across compilers, sta
Of all the language features introduced in C++23, deducing this — formally known as explicit object parameters — is the one that changes how you think about writing C++ classes. It is not just a conve
C++20 gave us consteval functions — functions that are guaranteed to run only at compile time. C++20 also gave us if constexpr — a way to branch at compile time based on a constant expression. But the
Before C++23, writing a matrix or tensor class in C++ required either ugly hack syntax or a fundamental compromise on usability. You could write matrix(row, col) using operator() — but that looked lik