[libcxx-commits] [PATCH] D98983: [libcxx] adds concepts `std::totally_ordered` and `std::totally_ordered_with`

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 23 13:11:48 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/concepts:217
   is_lvalue_reference_v<_Lhs> &&
-  common_reference_with<const remove_reference_t<_Lhs>&, const remove_reference_t<_Rhs>&> &&
+  common_reference_with<__const_lvalue_ref<_Lhs>, __const_lvalue_ref<_Rhs>> &&
   requires (_Lhs __lhs, _Rhs&& __rhs) {
----------------
cjdb wrote:
> Mordante wrote:
> > Minor bikeshed; since the standard type traits start with a verb I would like to do the same here. This "trait" is like `make_signed_t` so I would suggest `__make_const_lvalue_ref`.
> If we're going to add more characters, does this still benefit us over `const remove_reference_t<_Tp>&`?
IMHO even `__const_lvalue_ref<T>` has //already// lost the benefit of brevity. I wanted `__const_ref_t<T>` to be the spelling that creates a "const T ref"; I see no point to saying `lvalue` because, what, you expected a const //rvalue// ref? 😛I thought the trailing `_t` would be noncontroversial, but actually if people prefer `__const_ref<T>` or even `_ConstRef<T>` I think that's great.
Anyway, sounds like a huge bikeshed and I don't want to block anything either way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98983



More information about the libcxx-commits mailing list