This new release brings small improvements and fixes to the library:
- 🩹 Fix support for proxy iterators (#40, thanks @yuanzihao-1991 for reporting the issue), which notably makes the library work with
std::views::zip
:std::vector<std::string> names = { "Karim", "Mengyue", "Charles", "Martinho" }; std::vector<int> ages = { 32, 25, 53, 44 }; // Sort by age gfx::timsort( std::views::zip(names, ages), {}, [](auto const& value) { return std::get<1>(value); } ); std::print("{}", names); // ["Mengyue", "Karim", "Martinho", "Charles"] std::print("{}", ages); // [25, 32, 44, 53]
- 🔧
GFX_TIMSORT_ENABLE_AUDIT
now automatically enablesGFX_TIMSORT_ENABLE_ASSERT
too. - 🔧 Instances of of
iterator + 1
anditerator - 1
were replaced withstd::ranges::next
andstd::ranges::prev
respectively. Thestd::ranges
functions have a single-parameter overload which can useoperator++
/operator--
to increment the iterator instead ofoperator+
/operator-
, which can lead to much simpler logic for some iterators such as those ofstd::deque
. All in all this remains firmly into the realm of micro-optimization, the expected gains are small, likely unnoticeable. - 🔧 Reduce the number of template parameters of an internal class, leading to slightly smaller binaries in debug mode.
The test suite also benefited from some hardening:
- Compile with
/W4
on MSVC. - Compile with
_GLIBCXX_ASSERTIONS
,_LIBCPP_ENABLE_ASSERTIONS=1
, and_FORTIFY_SOURCE=3
. - Upgrade downloaded Catch2 version to v3.7.1.