mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-10-18 11:39:03 +02:00
Problem: message_t lacks empty() function
Solution: Add function and qualify with nodiscard like std types
This commit is contained in:
5
zmq.hpp
5
zmq.hpp
@@ -396,6 +396,11 @@ class message_t
|
||||
return zmq_msg_size(const_cast<zmq_msg_t *>(&msg));
|
||||
}
|
||||
|
||||
ZMQ_NODISCARD bool empty() const ZMQ_NOTHROW
|
||||
{
|
||||
return size() == 0u;
|
||||
}
|
||||
|
||||
template<typename T> T *data() ZMQ_NOTHROW { return static_cast<T *>(data()); }
|
||||
|
||||
template<typename T> T const *data() const ZMQ_NOTHROW
|
||||
|
Reference in New Issue
Block a user