mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-05-24 06:04:46 +02:00
genealize arithmetic operators for socket_base and derived (#470)
Generalize arithmetic operators for socket_base and derived
This commit is contained in:
parent
f428fee374
commit
1a4ebda46e
16
zmq.hpp
16
zmq.hpp
@ -2083,27 +2083,27 @@ inline bool operator!=(std::nullptr_t /*p*/, socket_ref sr) ZMQ_NOTHROW
|
|||||||
}
|
}
|
||||||
#endif
|
#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);
|
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;
|
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);
|
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);
|
return !(a < b);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user