Skip to content

Commit

Permalink
Fix the inequality operator in layout_left and layout_right, after #197
Browse files Browse the repository at this point in the history
  • Loading branch information
youyu3 committed Jan 6, 2023
1 parent 973ef64 commit 6b12cf2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/experimental/__p0009_bits/layout_left.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<class OtherExtents>
MDSPAN_INLINE_FUNCTION
friend constexpr bool operator!=(mapping const& lhs, mapping<OtherExtents> const& rhs) noexcept {
Expand Down
2 changes: 1 addition & 1 deletion include/experimental/__p0009_bits/layout_right.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<class OtherExtents>
MDSPAN_INLINE_FUNCTION
friend constexpr bool operator!=(mapping const& lhs, mapping<OtherExtents> const& rhs) noexcept {
Expand Down
1 change: 1 addition & 0 deletions tests/test_layout_ctors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class> struct TestLayoutCompatCtors;
Expand Down

0 comments on commit 6b12cf2

Please sign in to comment.