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

Generalize arithmetic operators for socket_base and derived #470

Merged
merged 2 commits into from
Mar 10, 2021
Merged
Changes from 1 commit
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
16 changes: 8 additions & 8 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2080,27 +2080,27 @@ inline bool operator!=(std::nullptr_t /*p*/, socket_ref sr) ZMQ_NOTHROW
}
#endif

inline bool operator==(socket_ref a, socket_ref b) ZMQ_NOTHROW
inline bool operator==(const detail::socket_base& a, const detail::socket_base& b) ZMQ_NOTHROW
{
return std::equal_to<void *>()(a.handle(), b.handle());
return std::equal_to<const void *>()(a.handle(), b.handle());
}
inline bool operator!=(socket_ref a, socket_ref b) ZMQ_NOTHROW
inline bool operator!=(const detail::socket_base& a, const detail::socket_base& b) ZMQ_NOTHROW
{
return !(a == b);
}
inline bool operator<(socket_ref a, socket_ref b) ZMQ_NOTHROW
inline bool operator<(const detail::socket_base& a, const detail::socket_base& b) ZMQ_NOTHROW
{
return std::less<void *>()(a.handle(), b.handle());
return std::less<const void *>()(a.handle(), b.handle());
}
inline bool operator>(socket_ref a, socket_ref b) ZMQ_NOTHROW
inline bool operator>(const detail::socket_base& a, const detail::socket_base& b) ZMQ_NOTHROW
{
return b < a;
}
inline bool operator<=(socket_ref a, socket_ref b) ZMQ_NOTHROW
inline bool operator<=(const detail::socket_base& a, const detail::socket_base& b) ZMQ_NOTHROW
{
return !(a > b);
}
inline bool operator>=(socket_ref a, socket_ref b) ZMQ_NOTHROW
inline bool operator>=(const detail::socket_base& a, const detail::socket_base& b) ZMQ_NOTHROW
{
return !(a < b);
}
Expand Down