|
Boost Users : |
Subject: Re: [Boost-users] [Signals] Is connection::disconnect() "const-correct"?
From: Greg Hickman (ghickman_at_[hidden])
Date: 2011-05-04 21:22:05
On Tue, May 3, 2011 at 10:10 PM, Frank Mori Hess <fmhess_at_[hidden]>wrote:
> To make things more concrete, suppose disconnect was non-const. It still
> wouldn't stop you from making a new non-const connection object that is a
> copy of the const connection object, and then disconnecting through the
> non-const connection object. So I guess I'm arguing that the connected()
> method isn't returning information about the state of the connection object
> itself, but rather the state of the thing it is a handle to.
>
I agree that a connection has reference semantics and that
connection::connected() therefore returns information about the thing being
referenced (as opposed to the handle itself). According the logic above,
however, doesn't the fact that connection::block() is non-const seem
inconsistent? In other words, it would seem that connection::disconnect()
and connection::block() should both be either const or non-const for
consistency.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net