mirror of
https://github.com/boostorg/array.git
synced 2025-07-31 13:17:21 +02:00
Add operator<=> overload for zero-sized arrays
This commit is contained in:
@ -396,6 +396,13 @@ namespace boost {
|
|||||||
return 0 <=> 0; // std::strong_ordering::equal
|
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
|
#endif
|
||||||
|
|
||||||
// undocumented and obsolete
|
// undocumented and obsolete
|
||||||
|
@ -77,11 +77,11 @@ template<class T, std::size_t N> void test()
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
// test<int, 0>();
|
test<int, 0>();
|
||||||
test<int, 1>();
|
test<int, 1>();
|
||||||
test<int, 7>();
|
test<int, 7>();
|
||||||
|
|
||||||
// test<float, 0>();
|
test<float, 0>();
|
||||||
test<float, 1>();
|
test<float, 1>();
|
||||||
test<float, 7>();
|
test<float, 7>();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user