Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround for clang/apple/libc++ #126

Merged
merged 4 commits into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion include/sparrow/typed_array.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Man Group Operations Limited

Check notice on line 1 in include/sparrow/typed_array.hpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on include/sparrow/typed_array.hpp

File include/sparrow/typed_array.hpp does not conform to Custom style guidelines. (lines 468, 471, 472, 478, 479)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -465,8 +465,25 @@
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(_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
DerThorsten marked this conversation as resolved.
Show resolved Hide resolved
}

} // namespace sparrow
Loading