mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-19 08:46:45 +01:00
Add const data access to message_t
Add a const version of data() and make size() const so we can pass messages around by const refeference when we only need read-only data access.
This commit is contained in:
parent
f1640d2c9d
commit
2efcdccace
9
zmq.hpp
9
zmq.hpp
@ -179,9 +179,14 @@ namespace zmq
|
||||
return zmq_msg_data (&msg);
|
||||
}
|
||||
|
||||
inline size_t size ()
|
||||
inline const void* data () const
|
||||
{
|
||||
return zmq_msg_size (&msg);
|
||||
return zmq_msg_data (const_cast<zmq_msg_t*>(&msg));
|
||||
}
|
||||
|
||||
inline size_t size () const
|
||||
{
|
||||
return zmq_msg_size (const_cast<zmq_msg_t*>(&msg));
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user