[libcxx-commits] [PATCH] D152753: [libc++] Refactor __debug_three_way_comp

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 13 10:57:59 PDT 2023


ldionne marked an inline comment as done.
ldionne added inline comments.


================
Comment at: libcxx/include/__algorithm/three_way_comp_ref_type.h:38-45
+
+  template <class _Tp, class _Up>
+  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __x, _Up& __y) {
+    auto __r = __comp_(__x, __y);
+    if constexpr (__comparison_category<decltype(__comp_(__x, __y))>)
+      __do_compare_assert(__y, __x, __r);
     return __r;
----------------
philnik wrote:
> I might have missed it, but I can't find any reason why we need this overload in the old threads. Do you have any reasoning for having this overload?
I'm not sure TBH. The tests seem to pass, and I do think it should be sufficient to use `const&`. I'll do it in a follow-up.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152753



More information about the libcxx-commits mailing list