Skip to content

Commit

Permalink
genealize arithmetic operators for socket_base and derived (#470)
Browse files Browse the repository at this point in the history
Generalize arithmetic operators for socket_base and derived
  • Loading branch information
albestro committed Mar 10, 2021
1 parent f428fee commit 1a4ebda
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2083,27 +2083,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

0 comments on commit 1a4ebda

Please sign in to comment.