From f77f9c3fe16a4db91c16f3d93323f20cb1472378 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Thu, 26 Mar 2020 19:30:09 -0500 Subject: [PATCH] Adding a few more static assertions. --- test/test.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test.cxx b/test/test.cxx index 793d9c6..c60eb9e 100644 --- a/test/test.cxx +++ b/test/test.cxx @@ -36,6 +36,12 @@ struct D: B { }; static_assert(equality_comparable_with, std::vector>); static_assert(totally_ordered_with, std::vector>); + +// mixed const-ness is fine +static_assert(totally_ordered_with, std::vector const>); +static_assert(totally_ordered_with, std::vector>); +static_assert(totally_ordered_with, std::vector const>); + static_assert(not equality_comparable_with, std::list>); static_assert(not equality_comparable_with, std::vector>); @@ -57,6 +63,10 @@ T const* end(X const& x) { return x.v.data() + x.v.size(); } static_assert(equality_comparable_with, X>); static_assert(totally_ordered_with, X>); +struct NonComparable { }; +static_assert(not equality_comparable_with, std::span>); +static_assert(not totally_ordered_with, std::span>); + #define CATCH_CONFIG_MAIN #include "catch.hpp"