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
Implement array reference with any #4096
Implement array reference with any #4096
Conversation
src/shogun/lib/any.h
Outdated
{ | ||
return true; | ||
} | ||
return std::equal(*(m_ptr), *(m_ptr) + *(m_length), *(other.m_ptr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be specialized for floats I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact need to check whether the elements support ".equals" or "->equals"
} | ||
return std::equal( | ||
*(m_ptr), *(m_ptr) + *(m_length), *(other.m_ptr), | ||
[](T lhs, T rhs) -> bool { return any_detail::compare(lhs, rhs); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is pretty cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test lgtm
No description provided.