mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-19 08:46:45 +01:00
Make getsockopt() functions const
Make the socket_t::getsockopt() functions (which wrap zmq_getsockopt() ) const because they should only access and not modify socket state.
This commit is contained in:
parent
bad35bdbfe
commit
c1e8ac0f19
4
zmq.hpp
4
zmq.hpp
@ -497,14 +497,14 @@ namespace zmq
|
||||
}
|
||||
|
||||
inline void getsockopt (int option_, void *optval_,
|
||||
size_t *optvallen_)
|
||||
size_t *optvallen_) const
|
||||
{
|
||||
int rc = zmq_getsockopt (ptr, option_, optval_, optvallen_);
|
||||
if (rc != 0)
|
||||
throw error_t ();
|
||||
}
|
||||
|
||||
template<typename T> T getsockopt(int option_)
|
||||
template<typename T> T getsockopt(int option_) const
|
||||
{
|
||||
T optval;
|
||||
size_t optlen = sizeof(T);
|
||||
|
Loading…
x
Reference in New Issue
Block a user