Fully transitive const is not necessary

Bill Baxter dnewsgroup at billbaxter.com
Wed Apr 2 16:46:18 PDT 2008


Walter Bright wrote:
> Janice Caron wrote:
>> We are suffering from a communications difficulty caused by you and I
>> using the same phrase ("logical const") to mean entirely different
>> things. Unless we can agree on a common terminology, we're not going
>> to be able to get anywhere with this discussion.
> 
> You're right. This thread will go nowhere as long as "logical const" 
> isn't defined.
> 
> My understanding of logical const, and the meaning I use of it, is the 
> C++ notion of a class that uses non-static fields declared as "mutable" 
> to implement a class that appears to be const from the user's 
> perspective, but actually has changing field values.
> 
> Mutating a static member is not logical const.

By using a global you can come up with something that is operationally 
equivalent to that definition of logical const.  So it made sense to 
also call that "logical const" as a short hand for "operationally 
equivalent to logical const using globals".  I'm not sure why anyone 
found that so terribly confusing.  But there's nothing wrong with being 
a little more precise, though we still don't have a good name for 
"operationally equivalent to logical const by use of globals".  Other 
than "globby" I mean. :-)

--bb



More information about the Digitalmars-d mailing list