Fully transitive const is not necessary

Steven Schveighoffer schveiguy at yahoo.com
Wed Apr 2 07:50:12 PDT 2008


"Simen Kjaeraas" wrote
> On Wed, 02 Apr 2008 16:41:33 +0200, Steven Schveighoffer  wrote:
>
>> "Simen Kjaeraas" wrote
>>> On Wed, 02 Apr 2008 16:04:36 +0200, Steven Schveighoffer  wrote:
>>>
>>>> - a pure method cannot access the mutable portion of a logically
>>>> invariant data value.
>>>
>>> Wouldn't this basically make it transitive invariant?
>>
>> Yes, which makes my point :)  pure must be transitive, but const / 
>> invariant
>> by itself does not need to be.
>>
>> -Steve
>
> So yes, you can do without transitive const, as long as you define logical 
> const as transitive. I can't quite see what point you're trying to make.

No, I'm not defining logical const as transitive.  I'm defining that pure is 
transitive.  pure functions have nothing to do with requiring const to be 
transitive, which is my point.

Did you look at my example in the original post?  What we have now is 
semantically equivalent to logical const.

-Steve 





More information about the Digitalmars-d mailing list