-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Mark Sizer Sent: Tuesday, October 21, 2003 10:04 PM To: boost-users@lists.boost.org Subject: [Boost-users] Re: Condition variable and const-correctness
I say that the difference between physical const and logical const is EXACTLY what you are saying it is: A logically const method does not change the internal state of the object. A phyically const method does not modify any members of the object. A phyically const method is necessarily logically const. The converse may not be true. The distinction is that a logically, but not physically, const method requires "mutable" member variables to compile.
Actually a physically const method might not be logically const. Take for example a string class which has a pointer to a buffer which holds the string (plus maybe some other bookkeeping members). The data pointed to is logically part of the object but is not physically part of it. A physically const method may not change the pointer, but is allowed to change the data pointed to by the pointer as this data is not "physically part of the object", but such an operation is not logically const. Richard Damon -- rbrdamon@rcn.com (Home) rdamon@beltronicsinc.com (Work)