From 68db6ebd2d4813bd5dbf5e9e1c57424fdd003fde Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 27 Jan 2025 03:59:32 +0200 Subject: [PATCH] Add operator<=> overload for zero-sized arrays --- include/boost/array.hpp | 7 +++++++ test/array_thw_test.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/boost/array.hpp b/include/boost/array.hpp index 995a888..d1a7a2b 100644 --- a/include/boost/array.hpp +++ b/include/boost/array.hpp @@ -396,6 +396,13 @@ namespace boost { return 0 <=> 0; // std::strong_ordering::equal } + template + constexpr auto operator<=> (const array& x, const array& y) + -> decltype( 0 <=> 0 ) + { + return 0 <=> 0; // std::strong_ordering::equal + } + #endif // undocumented and obsolete diff --git a/test/array_thw_test.cpp b/test/array_thw_test.cpp index 3376e36..8f10368 100644 --- a/test/array_thw_test.cpp +++ b/test/array_thw_test.cpp @@ -77,11 +77,11 @@ template void test() int main() { - // test(); + test(); test(); test(); - // test(); + test(); test(); test();