[libcxx-commits] [PATCH] D131357: [libc++] Implement `operator<=>` for `type_index`
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 8 10:28:36 PDT 2022
Mordante added a comment.
LGTM modulo some nits. I think the CI failures are unrelated, but please update the review for a CI iteration.
I want to have a quick look after the update.
================
Comment at: libcxx/include/typeindex:97
+#if _LIBCPP_STD_VER > 17
+ _LIBCPP_INLINE_VISIBILITY
+ strong_ordering operator<=>(const type_index& __y) const noexcept {
----------------
================
Comment at: libcxx/include/typeindex:98
+ _LIBCPP_INLINE_VISIBILITY
+ strong_ordering operator<=>(const type_index& __y) const noexcept {
+ if (*__t_ == *__y.__t_) return strong_ordering::equal;
----------------
Please run clang-format on these changes.
================
Comment at: libcxx/test/std/utilities/type.index/type.index.members/cmp.pass.cpp:48
+ // Test `t1` and `t3` which are not equal
+ bool isLess = t1 < t3;
+ assert(testComparisons(t1, t3, /*isEqual*/ false, isLess));
----------------
We use snake-case in our tests.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131357/new/
https://reviews.llvm.org/D131357
More information about the libcxx-commits
mailing list