Skip to content

Commit

Permalink
workaround for clang/apple/libc++
Browse files Browse the repository at this point in the history
  • Loading branch information
DerThorsten committed Jul 1, 2024
1 parent 91b9842 commit de66530
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions include/sparrow/typed_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,25 @@ namespace sparrow
template <class T, class Layout>
requires is_arrow_base_type<T>
bool operator==(const typed_array<T, Layout>& ta1, const typed_array<T, Layout>& ta2)
{
return std::equal(ta1.cbegin(), ta1.cend(), ta2.cbegin(), ta2.cend());
{
// see https://github.com/man-group/sparrow/issues/108
#if defined(__APPLE__) && defined(__clang__) && defined(_LIBCPP_VERSION)
if(ta1.size() != ta2.size())
{
return false;
}
auto first1 = ta1.begin();
auto last1 = ta1.end();
auto first2 = ta2.begin();
for(; first1 != last1; ++first1, ++first2){
if (!(*first1 == *first2)){
return false;
}
}
return true;
#else
return std::equal(ta1.begin(), ta1.end(), ta2.begin(), ta2.end());
#endif
}

} // namespace sparrow

0 comments on commit de66530

Please sign in to comment.