C++26: More constexpr in the Standard Library -- Sandor Dargo
Here are the standard library features that will soon be usable at compile time. One topic is missing: exceptions. As they need both core language and library changes, I thought they deserved their own post.
C++26: More constexpr in the Standard Library
by Sandor Dargo
From the article:
P2562R1:
constexprstable sortingThis paper proposes making
std::stable_sort,std::stable_partition,std::inplace_merge, and theirrangescounterparts usable in constant expressions. While many algorithms have becomeconstexprover the years, this family related to stable sorting had remained exceptions — until now.The recent introduction of
constexprcontainers gives extra motivation for this proposal. If you can construct a container at compile time, it’s only natural to want to sort it there, too. More importantly, aconstexpr std::vectorcan now support efficient, stable sorting algorithms.A key question is whether the algorithm can meet its computational complexity requirements under the constraints of constant evaluation. Fortunately,
std::is_constant_evaluated()provides an escape hatch for implementations. For deeper details, check out the proposal itself.

Some time ago, we developed a
C++ continues to refine its range library, offering developers more efficient and expressive ways to manipulate collections. In this post, we'll dive into three powerful range adaptors—
Modern C++ offers a variety of ways to work with key-value data structures like 
Constexpr has been around for a while now, but many don’t fully understand its subtleties. Andreas Fertig explores its use and when a constexpr expression might not be evaluated at compile time.