[libcxx-commits] [PATCH] D148416: [libc++][spaceship] Implement `operator<=>` for `multiset` and `set`
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat May 6 06:16:08 PDT 2023
Mordante added a comment.
Thanks for working on this. Some comments.
================
Comment at: libcxx/include/set:1044
+template <class _Key, class _Allocator>
+inline _LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Key>
+operator<=>(const set<_Key, _Allocator>& __x, const set<_Key, _Allocator>& __y) {
----------------
================
Comment at: libcxx/test/std/containers/associative/multiset/multiset.nonmember/compare.three_way.pass.cpp:24
+int main(int, char**) {
+ assert(test_ordered_set_container_spaceship<std::multiset>());
+ // `std::multiset` is not constexpr, so no `static_assert` test here.
----------------
Does this also test containers where `Compare != std::less` ?
================
Comment at: libcxx/test/support/test_container_comparisons.h:233
+ {
+ Container<Elem> l1{1, 2, 2, 4};
+ Container<Elem> l2{1, 1, 2, 3};
----------------
Does this work with a `set`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148416/new/
https://reviews.llvm.org/D148416
More information about the libcxx-commits
mailing list