[libcxx-commits] [PATCH] D100429: [libc++][ranges] Add range.cmp: equal_to, not_equal_to, less, etc.

Tim Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 21 06:52:35 PDT 2021


tcanens added inline comments.


================
Comment at: libcxx/include/functional:3236
+  _LIBCPP_NOEXCEPT_RETURN(
+    _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)
+  )
----------------
The implicit conversion to `bool` is not captured in the `noexcept`, ditto elsewhere.


================
Comment at: libcxx/test/support/pointer_comparison_test_helper.h:12
+template <template <class> class CompareTemplate>
+void do_pointer_comparison_test() {
+  typedef CompareTemplate<int*> Compare;
----------------
If you want to test this sort of thing, I'd suggest something like the example from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78420#c0. "Comparison produces a total order when the built-in is required to" (which describes 3/4 of the test cases below) is not a particularly interesting property compared to "comparison produces a total order even when the built-in is not required to".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100429/new/

https://reviews.llvm.org/D100429



More information about the libcxx-commits mailing list