
On Tue, May 3, 2011 at 10:10 PM, Frank Mori Hess
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.