mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-12 10:33:52 +01:00
Merge pull request #319 from gummif/gfa/msg-init
Problem: zmq_msg_init never fails
This commit is contained in:
commit
ec8a30a050
13
zmq.hpp
13
zmq.hpp
@ -235,11 +235,10 @@ inline std::tuple<int, int, int> version()
|
|||||||
class message_t
|
class message_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
message_t()
|
message_t() ZMQ_NOTHROW
|
||||||
{
|
{
|
||||||
int rc = zmq_msg_init(&msg);
|
int rc = zmq_msg_init(&msg);
|
||||||
if (rc != 0)
|
ZMQ_ASSERT(rc == 0);
|
||||||
throw error_t();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit message_t(size_t size_)
|
explicit message_t(size_t size_)
|
||||||
@ -284,11 +283,10 @@ class message_t
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ZMQ_HAS_RVALUE_REFS
|
#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);
|
int rc = zmq_msg_init(&rhs.msg);
|
||||||
if (rc != 0)
|
ZMQ_ASSERT(rc == 0);
|
||||||
throw error_t();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message_t &operator=(message_t &&rhs) ZMQ_NOTHROW
|
message_t &operator=(message_t &&rhs) ZMQ_NOTHROW
|
||||||
@ -310,8 +308,7 @@ class message_t
|
|||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
throw error_t();
|
throw error_t();
|
||||||
rc = zmq_msg_init(&msg);
|
rc = zmq_msg_init(&msg);
|
||||||
if (rc != 0)
|
ZMQ_ASSERT(rc == 0);
|
||||||
throw error_t();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rebuild(size_t size_)
|
void rebuild(size_t size_)
|
||||||
|
Loading…
Reference in New Issue
Block a user