diff --git a/include/experimental/__p0009_bits/layout_left.hpp b/include/experimental/__p0009_bits/layout_left.hpp index 2b3a9bdf..bb17c449 100644 --- a/include/experimental/__p0009_bits/layout_left.hpp +++ b/include/experimental/__p0009_bits/layout_left.hpp @@ -188,7 +188,7 @@ class layout_left::mapping { } // In C++ 20 the not equal exists if equal is found -#if MDSPAN_HAS_CXX_20 +#if !(MDSPAN_HAS_CXX_20) template MDSPAN_INLINE_FUNCTION friend constexpr bool operator!=(mapping const& lhs, mapping const& rhs) noexcept { diff --git a/include/experimental/__p0009_bits/layout_right.hpp b/include/experimental/__p0009_bits/layout_right.hpp index 2ab20f19..dc345806 100644 --- a/include/experimental/__p0009_bits/layout_right.hpp +++ b/include/experimental/__p0009_bits/layout_right.hpp @@ -190,7 +190,7 @@ class layout_right::mapping { } // In C++ 20 the not equal exists if equal is found -#if MDSPAN_HAS_CXX_20 +#if !(MDSPAN_HAS_CXX_20) template MDSPAN_INLINE_FUNCTION friend constexpr bool operator!=(mapping const& lhs, mapping const& rhs) noexcept { diff --git a/tests/test_layout_ctors.cpp b/tests/test_layout_ctors.cpp index e4e3475f..5a83a585 100644 --- a/tests/test_layout_ctors.cpp +++ b/tests/test_layout_ctors.cpp @@ -68,6 +68,7 @@ TYPED_TEST(TestLayoutCtors, default_ctor) { auto m2 = typename TestFixture::mapping_type{}; ASSERT_EQ(m2.extents(), typename TestFixture::extents_type{}); ASSERT_EQ(m, m2); + ASSERT_FALSE(m != m2); } template struct TestLayoutCompatCtors;