Merge pull request #337 from gummif/gfa/clang-warnings

Problem: Warnings about send being deprecated
This commit is contained in:
Simon Giesecke 2019-09-02 12:26:20 +02:00 committed by GitHub
commit 3b1038d035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
zmq.hpp
View File

@ -1213,10 +1213,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