[libcxx-commits] [PATCH] D131421: [libc++] Uses operator<=> in string.
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 8 11:25:34 PDT 2022
Mordante marked an inline comment as not done.
Mordante added inline comments.
================
Comment at: libcxx/include/string:55
+ using comparison_category = strong_ordering; // Since C++20 only for the specializations
+ // char, wchar_t, char8_t, char16_t, and char32_t.
----------------
This was implemented in D130295.
================
Comment at: libcxx/include/string:4175
template<class _Allocator>
inline _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI
----------------
This is an optimization that gives a modest performance improvement `210051548ea01357cc834ce8917559ca32b7a137` so decided to keep it. But maybe something to consider during review.
================
Comment at: libcxx/test/std/strings/basic.string/string.nonmembers/string.cmp/comparison.pass.cpp:63
+ for (size_t j = 0; j < v.size(); ++j) {
+ assert(testOrder(v[i], v[j], i == j ? Ordering::equivalent : i < j ? Ordering::less : Ordering::greater));
+
----------------
Note `basic_string` `basic_string_view` comparison is part of the `string_view` header and tested in the `string_view` tests.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131421/new/
https://reviews.llvm.org/D131421
More information about the libcxx-commits
mailing list