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

Ruslan Arutyunyan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 13 06:34:07 PDT 2021


rarutyun marked 7 inline comments as done.
rarutyun added inline comments.


================
Comment at: libcxx/include/CMakeLists.txt:102
   __compare/ordering.h
+  __compare/three_way_comparable.h
   __concepts/arithmetic.h
----------------
Quuxplusone wrote:
> You'll also need to update `module.modulemap` and run the various Python generator scripts (which you can now do via `ninja libcxx-generate-files` or `make libcxx-generate-files`). Make sure to commit the changed //and added// new files.
Yep, I figured it out from CI results. Done


================
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>;
+  };
----------------
cjdb wrote:
> Quuxplusone wrote:
> > ```
> > requires(__make_const_lvalue_ref<_Tp> __t) {
> >     { __t <=> __t } -> __compares_as<_Cat>;
> > ```
> > Let's keep it simple (and close to the reference implementation).
> We shouldn't deviate from what's in the standard. The concept is defined the way it is way for a reason.
Agree with Christopher


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