Skip to content

Commit

Permalink
Merge pull request #4 from ricnewton/const_data_access
Browse files Browse the repository at this point in the history
Add const data access to message_t
  • Loading branch information
hintjens committed Aug 29, 2012
2 parents 1a35020 + 2efcdcc commit 90d870b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,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:
Expand Down

0 comments on commit 90d870b

Please sign in to comment.