Skip to content

Commit

Permalink
restrict workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten committed Jul 1, 2024
1 parent de66530 commit 2aa051a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/sparrow/typed_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,22 +467,23 @@ namespace sparrow
bool operator==(const typed_array<T, Layout>& ta1, const typed_array<T, Layout>& ta2)
{
// see https://github.com/man-group/sparrow/issues/108
#if defined(__APPLE__) && defined(__clang__) && defined(_LIBCPP_VERSION)
#if defined(__APPLE__) && defined(__clang__) && defined(_LIBCPP_VERSION) && (__clang_major__ < 18)

if(ta1.size() != ta2.size())
{
return false;
}
auto first1 = ta1.begin();
auto last1 = ta1.end();
auto first2 = ta2.begin();
auto first1 = ta1.cbegin();
auto last1 = ta1.cend();
auto first2 = ta2.cbegin();
for(; first1 != last1; ++first1, ++first2){
if (!(*first1 == *first2)){
return false;
}
}
return true;
#else
return std::equal(ta1.begin(), ta1.end(), ta2.begin(), ta2.end());
return std::equal(ta1.cbegin(), ta1.cend(), ta2.cbegin(), ta2.cend());
#endif
}

Expand Down

0 comments on commit 2aa051a

Please sign in to comment.