Merge pull request #319 from gummif/gfa/msg-init

Problem: zmq_msg_init never fails
This commit is contained in:
Simon Giesecke 2019-05-08 23:25:48 +02:00 committed by GitHub
commit ec8a30a050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
zmq.hpp
View File

@ -235,11 +235,10 @@ inline std::tuple<int, int, int> version()
class message_t
{
public:
message_t()
message_t() ZMQ_NOTHROW
{
int rc = zmq_msg_init(&msg);
if (rc != 0)
throw error_t();
ZMQ_ASSERT(rc == 0);
}
explicit message_t(size_t size_)
@ -284,11 +283,10 @@ class message_t
#endif
#ifdef ZMQ_HAS_RVALUE_REFS
message_t(message_t &&rhs) : msg(rhs.msg)
message_t(message_t &&rhs) ZMQ_NOTHROW : msg(rhs.msg)
{
int rc = zmq_msg_init(&rhs.msg);
if (rc != 0)
throw error_t();
ZMQ_ASSERT(rc == 0);
}
message_t &operator=(message_t &&rhs) ZMQ_NOTHROW
@ -310,8 +308,7 @@ class message_t
if (rc != 0)
throw error_t();
rc = zmq_msg_init(&msg);
if (rc != 0)
throw error_t();
ZMQ_ASSERT(rc == 0);
}
void rebuild(size_t size_)