Problem: message_t lacks empty() function

Solution: Add function and qualify with nodiscard like std types
This commit is contained in:
Gudmundur Adalsteinsson
2019-04-04 17:55:27 +00:00
parent 5c95a07d72
commit 16f16eeaad
2 changed files with 8 additions and 0 deletions

View File

@@ -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