Skip to content

3.0.1

Latest
Compare
Choose a tag to compare
@Morwenn Morwenn released this 03 Dec 19:58

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 enables GFX_TIMSORT_ENABLE_ASSERT too.
  • 🔧 Instances of of iterator + 1 and iterator - 1 were replaced with std::ranges::next and std::ranges::prev respectively. The std::ranges functions have a single-parameter overload which can use operator++/operator-- to increment the iterator instead of operator+/operator-, which can lead to much simpler logic for some iterators such as those of std::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.