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 676649c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion include/sparrow/typed_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,26 @@ 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)
{
{
// see https://github.com/man-group/sparrow/issues/108
#if defined(__APPLE__) && defined(__clang__) && defined(_LIBCPP_VERSION) && (__clang_major__ < 18)

if(ta1.size() != ta2.size())
{
return false;
}
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.cbegin(), ta1.cend(), ta2.cbegin(), ta2.cend());
#endif
}

} // namespace sparrow

0 comments on commit 676649c

Please sign in to comment.