#cpp23
2 posts tagged #cpp23.
std::flat_map is just two vectors
C++23's std::flat_map is an adaptor over a sorted vector of keys and a parallel vector of values. That buys cache-friendly lookups and near-zero memory overhead, and costs O(n) insertion and aggressive iterator invalidation. It replaces std::map, not std::unordered_map, and knowing which vector trick it is tells you exactly when to reach for it.
What reinterpret_cast doesn't do: Fertig on std::start_lifetime_as and the C++23 escape hatch
Andreas Fertig's 2026-05-18 post (re-shared on isocpp.org) makes a pointed case: reinterpret_cast and std::start_lifetime_as look interchangeable -- but only if you don't read the abstract-machine fine print. reinterpret_cast is a POINTER operation; std::start_lifetime_as is an OBJECT-LIFETIME operation. The 5-line difference between UB-then-it-works-on-my-compiler and defined-behavior.