[libcxx-commits] [PATCH] D150188: [libc++][spaceship] Fixed `__debug_three_way_comp`'s `operator()`
Hristo Hristov via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 22 13:22:38 PDT 2023
H-G-Hristov 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));
----------------
Mordante wrote:
> "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?
I replaced the two overloads in `comp_ref_type` with the perfect forwarding version as philnik recommended, which should has the same effect, right? Maybe I need to change the message?
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