[libcxx-commits] [PATCH] D107036: [WIP] [libc++] [P1614] Various unimplemented parts of <compare>. [WIP]

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Aug 29 16:03:52 PDT 2021


jloser added inline comments.


================
Comment at: libcxx/include/__compare/cmp_alg.h:45
+    template<class _Ep, class _Fp, class _Dp = decay_t<_Ep>>
+        requires is_same_v<_Dp, decay_t<_Fp>> && is_floating_point_v<_Dp>
+    _LIBCPP_HIDE_FROM_ABI static strong_ordering
----------------
Should we use `std::same_as` and `std::floating_point` concepts instead? Same applies to other uses ofG type traits that are concepts now as well.


================
Comment at: libcxx/test/std/utilities/function.objects/comparisons/compare_three_way.pass.cpp:25
+    -> decltype(std::compare_three_way()(t, u), std::true_type{})
+    { return std::true_type{}; }
+
----------------
Any reason to prefer this over just `return true;`? Similarly for the fallback overload (except `return false;` in that case).


================
Comment at: libcxx/test/std/utilities/function.objects/comparisons/transparent.pass.cpp:60
+#if TEST_STD_VER > 17
+    static_assert(   is_transparent<std::compare_three_way>::value, "" );
+#endif
----------------
We can drop the empty string second argument if you care.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107036



More information about the libcxx-commits mailing list