mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-05-16 20:02:03 +02:00
Problem: Warnings about send being deprecated
Solution: Refactoring and addition deprecation of a send function taking int flags
This commit is contained in:
parent
d25c58a05d
commit
85b3a945d4
13
zmq.hpp
13
zmq.hpp
@ -1146,10 +1146,19 @@ public:
|
||||
throw error_t();
|
||||
}
|
||||
|
||||
template<typename T> bool send(T first, T last, int flags_ = 0)
|
||||
template<typename T>
|
||||
#ifdef ZMQ_CPP11
|
||||
ZMQ_DEPRECATED("from 4.4.1, use send taking message_t or buffer (for contiguous ranges), and send_flags")
|
||||
#endif
|
||||
bool send(T first, T last, int flags_ = 0)
|
||||
{
|
||||
zmq::message_t msg(first, last);
|
||||
return send(msg, flags_);
|
||||
int nbytes = zmq_msg_send(msg.handle(), _handle, flags_);
|
||||
if (nbytes >= 0)
|
||||
return true;
|
||||
if (zmq_errno() == EAGAIN)
|
||||
return false;
|
||||
throw error_t();
|
||||
}
|
||||
|
||||
#ifdef ZMQ_HAS_RVALUE_REFS
|
||||
|
Loading…
x
Reference in New Issue
Block a user