mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-19 08:46:45 +01:00
Problem: recv return value should not be ignored
Solution: add nodiscard attribute to recv functions
This commit is contained in:
parent
fdb2f13971
commit
4bc232c175
4
zmq.hpp
4
zmq.hpp
@ -1348,7 +1348,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ZMQ_CPP11
|
#ifdef ZMQ_CPP11
|
||||||
detail::recv_buffer_result_t recv(mutable_buffer buf,
|
ZMQ_NODISCARD detail::recv_buffer_result_t recv(mutable_buffer buf,
|
||||||
recv_flags flags = recv_flags::none)
|
recv_flags flags = recv_flags::none)
|
||||||
{
|
{
|
||||||
const int nbytes =
|
const int nbytes =
|
||||||
@ -1362,7 +1362,7 @@ public:
|
|||||||
throw error_t();
|
throw error_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
detail::recv_result_t recv(message_t &msg, recv_flags flags = recv_flags::none)
|
ZMQ_NODISCARD detail::recv_result_t recv(message_t &msg, recv_flags flags = recv_flags::none)
|
||||||
{
|
{
|
||||||
const int nbytes = zmq_msg_recv(msg.handle(), _handle, static_cast<int>(flags));
|
const int nbytes = zmq_msg_recv(msg.handle(), _handle, static_cast<int>(flags));
|
||||||
if (nbytes >= 0) {
|
if (nbytes >= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user