Add operator<=> overload for zero-sized arrays

This commit is contained in:
Peter Dimov
2025-01-27 03:59:32 +02:00
parent 329e59454f
commit 68db6ebd2d
2 changed files with 9 additions and 2 deletions

View File

@ -396,6 +396,13 @@ namespace boost {
return 0 <=> 0; // std::strong_ordering::equal
}
template<class T>
constexpr auto operator<=> (const array<T,0>& x, const array<T,0>& y)
-> decltype( 0 <=> 0 )
{
return 0 <=> 0; // std::strong_ordering::equal
}
#endif
// undocumented and obsolete

View File

@ -77,11 +77,11 @@ template<class T, std::size_t N> void test()
int main()
{
// test<int, 0>();
test<int, 0>();
test<int, 1>();
test<int, 7>();
// test<float, 0>();
test<float, 0>();
test<float, 1>();
test<float, 7>();