[libcxx-commits] [PATCH] D152753: [libc++] Refactor __debug_three_way_comp
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 13 12:16:26 PDT 2023
philnik accepted this revision.
philnik added a comment.
This revision is now accepted and ready to land.
LGTM with comment.
================
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;
----------------
ldionne wrote:
> ldionne wrote:
> > 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.
> Actually some of our tests fail when I remove it.
Weird. I think this should be investigated and a comment added here, since it's not obvious.
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