Skip to content

Commit

Permalink
Problem: Warnings about send being deprecated
Browse files Browse the repository at this point in the history
Solution: Refactoring and addition deprecation of a send function taking
int flags
  • Loading branch information
gummif committed Aug 14, 2019
1 parent d25c58a commit 85b3a94
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,10 +1146,19 @@ class socket_base
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
Expand Down

0 comments on commit 85b3a94

Please sign in to comment.