Skip to content

Commit c1e8ac0

Browse files
committed
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.
1 parent bad35bd commit c1e8ac0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zmq.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,14 +497,14 @@ namespace zmq
497497
}
498498

499499
inline void getsockopt (int option_, void *optval_,
500-
size_t *optvallen_)
500+
size_t *optvallen_) const
501501
{
502502
int rc = zmq_getsockopt (ptr, option_, optval_, optvallen_);
503503
if (rc != 0)
504504
throw error_t ();
505505
}
506506

507-
template<typename T> T getsockopt(int option_)
507+
template<typename T> T getsockopt(int option_) const
508508
{
509509
T optval;
510510
size_t optlen = sizeof(T);

0 commit comments

Comments
 (0)