[llvm] [SLP] Use static_assert() rather than assert() where possible (PR #180867)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 11 06:05:19 PST 2026
================
@@ -1975,6 +1975,22 @@ template <typename R> bool is_sorted(R &&Range) {
return std::is_sorted(adl_begin(Range), adl_end(Range));
}
+/// Check if elements in a range \p R are sorted with respect to a comparator \p
+/// C. constexpr allows use in static_assert
+/// TODO: Use std::is_sorted once upgraded to Cpp20
+template <typename It, typename Cmp = std::less<>>
----------------
kuhar wrote:
This should probably go to STLForwardCompat.h
https://github.com/llvm/llvm-project/pull/180867
More information about the llvm-commits
mailing list