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

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 25 10:35:04 PDT 2021


zoecarver added a comment.

Just a few comments right now. I'll try to do a more in-depth review later.



================
Comment at: libcxx/include/type_traits:4500
 
+#if _LIBCPP_STD_VER > 11
+template<class _Tp>
----------------
Why is this guarded on C++11?


================
Comment at: libcxx/test/std/concepts/comparison/concepts.totallyordered/totally_ordered.pass.cpp:13
+// template<class T>
+// concept totally_ordered = // see below
+
----------------
Is this actually stated below? Maybe just say "concept totally_ordered"


================
Comment at: libcxx/test/std/concepts/comparison/concepts.totallyordered/totally_ordered.pass.cpp:115
+struct A {};
+// FIXME(cjdb): uncomment when operator<=> is implemented for each of these types.
+// static_assert(!std::totally_ordered<std::array<A, 10> >);
----------------
Then do we need to include all those extra headers (i.e., `std::vector`)?


================
Comment at: libcxx/test/std/concepts/comparison/concepts.totallyordered/totally_ordered_with.pass.cpp:1011
+static_assert(
+    check_totally_ordered_with<std::array<int, 10>, std::array<int, 10> >());
+static_assert(!check_totally_ordered_with<std::array<int, 10>,
----------------
Nit: I don't think we want/need the space between these. This isn't run in C++03 mode. 


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