Merge pull request #62 from gdfast/patch-2

Make getsockopt() functions const
This commit is contained in:
Constantin Rack 2015-11-19 20:05:58 +01:00
commit 2e22e3fc45

View File

@ -497,14 +497,14 @@ namespace zmq
} }
inline void getsockopt (int option_, void *optval_, inline void getsockopt (int option_, void *optval_,
size_t *optvallen_) size_t *optvallen_) const
{ {
int rc = zmq_getsockopt (ptr, option_, optval_, optvallen_); int rc = zmq_getsockopt (ptr, option_, optval_, optvallen_);
if (rc != 0) if (rc != 0)
throw error_t (); throw error_t ();
} }
template<typename T> T getsockopt(int option_) template<typename T> T getsockopt(int option_) const
{ {
T optval; T optval;
size_t optlen = sizeof(T); size_t optlen = sizeof(T);