diff --git a/include/sparrow/typed_array.hpp b/include/sparrow/typed_array.hpp index 812fd4e6..4ea575ec 100644 --- a/include/sparrow/typed_array.hpp +++ b/include/sparrow/typed_array.hpp @@ -465,8 +465,25 @@ namespace sparrow template requires is_arrow_base_type bool operator==(const typed_array& ta1, const typed_array& ta2) - { + { + // see https://github.com/man-group/sparrow/issues/108 +#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 180000) + 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