[libcxx-commits] [PATCH] D103478: [libc++][compare] Implement three_way_comparable[_with] concepts

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 12 20:27:30 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/__compare/three_way_comparable.h:34-35
+  __partially_ordered_with<_Tp, _Tp> &&
+  requires(__make_const_lvalue_ref<_Tp> __a, __make_const_lvalue_ref<_Tp> __b) {
+    { __a <=> __b } -> __compares_as<_Cat>;
+  };
----------------
```
requires(__make_const_lvalue_ref<_Tp> __t) {
    { __t <=> __t } -> __compares_as<_Cat>;
```
Let's keep it simple (and close to the reference implementation).


================
Comment at: libcxx/include/__compare/three_way_comparable.h:44
+  three_way_comparable<
+    common_reference_t<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>>, _Cat> &&
+  __weakly_equality_comparable_with<_Tp, _Up> &&
----------------
Let's eliminate this linebreak.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103478



More information about the libcxx-commits mailing list