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

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 26 12:13:22 PDT 2021


cjdb marked 3 inline comments as done.
cjdb added inline comments.


================
Comment at: libcxx/include/type_traits:4500
 
+#if _LIBCPP_STD_VER > 11
+template<class _Tp>
----------------
zoecarver wrote:
> Why is this guarded on C++11?
We did something similar in the `common_reference` patch where @ldionne and I agreed that it could be guarded on C++11 (I don't recall why). If you //really// want it in C++11 mode, I'll need to know what the C++03 guard is.


================
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> >);
----------------
zoecarver wrote:
> Then do we need to include all those extra headers (i.e., `std::vector`)?
Yes, see immediately above.


================
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>,
----------------
zoecarver wrote:
> Nit: I don't think we want/need the space between these. This isn't run in C++03 mode. 
https://github.com/llvm/llvm-project/blob/main/libcxx/.clang-format#L5


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