Skip to content

Changelog

GitHub Action edited this page Sep 21, 2025 · 23 revisions

This page describes the features that change in cpp-sort depending on the C++ version with which it is compiled (C++17 or later) as well as the support for miscellaneous compiler extensions; for a full changelog between actual releases, you can check the dedicated releases page.

C++14 features

While cpp-sort theoretically requires a fully C++17-compliant compiler, a few standard features are either not available or deactivated in some popular compilers and the library tries to take those into account when possible.

Performance improvements:

  • Sized deallocation: this C++14 feature is not always available (Clang requires -fsized-deallocation for example) and standard allocation functions typically don't take advantage of it. However, if __cpp_sized_deallocation is defined and the global deallocations functions are replaced with overloads that take advantage of sized deallocation, then several sorters will explicitly try to take advantage of it.

C++20 features

When compiled with C++20, cpp-sort might gain a few additional features depending on the level of C++20 support provided by the compiler. The availability of those features depends on the presence of corresponding feature-testing macros when possible, even though some checks are more granular. Don't hesitate to open an issue if your compiler and standard library supports one of those features but it doesn't seem to work in cpp-sort.

New features:

Other features

cpp-sort tries to take advantage of more than just standard features when possible by using implementation-specific tweaks to improve the user experience. The following improvements might be available depending on the your standard implementation:

Additional features:

  • 128-bit integers support: counting_sorter and ska_sorter have dedicated support for 128-bit integers (unsigned __int128 or __uint128_t and its signed counterpart), no matter whether the standard library is also instrumented for those types. This support should be available as long as the macro __SIZEOF_INT128__ is defined.

Performance improvements:

  • Bit manipulation intrinsics: there are a few places where bit tricks are used to perform a few operations faster. Some of those operations are made faster with bitwise manipulation intrinsics when those are available.

  • Assumptions: some algorithms use assumptions in select places to make the compiler generate more efficient code. Whether such assumptions are available depends on the compiler.

  • Vectorized algorithms: when compiled against the Microsoft STL, cpp-sort tries to take advantage of their vectorized algorithms when possible. This improves some algorithms when sorting contiguous collections of trivially copyable types.

  • When using libstdc++, libc++ or the Microsoft STL, the return type of std::mem_fn is considered "probably branchless" when it wraps a pointer to data member, which can improve the speed of pdq_sorter and everything that relies on it in some scenarios.

Clone this wiki locally