[libcxx-commits] [PATCH] D150188: [libc++][spaceship] Fixed `__debug_three_way_comp`'s `operator()`

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 22 10:40:05 PDT 2023


Mordante added inline comments.


================
Comment at: libcxx/include/__algorithm/three_way_comp_ref_type.h:32
   template <class _Tp, class _Up>
-  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __x, _Up& __y) {
-    auto __r = __comp_(__x, __y);
+  _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __x, _Up&& __y) {
+    auto __r = __comp_(std::forward<_Tp>(__x), std::forward<_Up>(__y));
----------------
"three_way_comp_ref_type's implementation is inspired by comp_ref_type, which has two overloads:"

I'm a bit confused. Here you don't use two overloads. Can you explain the difference between the message and the implementation?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150188



More information about the libcxx-commits mailing list