[libcxx-commits] [PATCH] D132312: [libc++][spaceship] Implement `operator<=>` for `list`
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Feb 18 05:41:19 PST 2023
Mordante added inline comments.
================
Comment at: libcxx/test/std/containers/sequences/list/compare.three_way.pass.cpp:21
+
+int main() {
+ assert(test_ordered_container_spaceship<std::list>());
----------------
================
Comment at: libcxx/test/support/test_container_comparisons.h:10
+
+#include "test_comparisons.h"
+
----------------
Please add include guards.
================
Comment at: libcxx/test/support/test_container_comparisons.h:14
+template <template <typename...> typename Container, typename Elem, typename Order>
+static constexpr void test_ordered_container_spaceship_with_type() {
+ // Empty containers
----------------
================
Comment at: libcxx/test/support/test_container_comparisons.h:61
+template <template <typename...> typename Container>
+static constexpr bool test_ordered_container_spaceship() {
+ // The container should fulfil `std::three_way_comparable`
----------------
================
Comment at: libcxx/test/support/test_container_comparisons.h:78
+
+ return true;
+}
----------------
I think these tests can be extended a bit, it feels like they now use a small number of types. I also miss tests for `<=` to be true/false for certain values.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132312/new/
https://reviews.llvm.org/D132312
More information about the libcxx-commits
mailing list