Logical const

Steven Schveighoffer schveiguy at yahoo.com
Fri Dec 3 04:59:19 PST 2010


On Thu, 02 Dec 2010 20:38:01 -0500, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> Steven Schveighoffer wrote:
>> On Thu, 02 Dec 2010 13:57:04 -0500, Bruno Medeiros  
>> <brunodomedeiros+spam at com.gmail> wrote:
>>
>>> On 29/11/2010 14:56, Steven Schveighoffer wrote:
>>>> This has been discussed at length on this newsgroup, and I argued for  
>>>> it
>>>> for a long time.  You will not get any traction with Walter, because
>>>> I've already proven that logical const == const, and it still doesn't
>>>> change his mind.
>>>
>>> Could you detail a bit what do you mean by logical const == const ?  
>>> That doesn't sound right to me.
>>>
>>  Here is where I show how logical const already exists, it's just  
>> clunky to use.
>>  BTW, this was before TLS, so the example would have to be updated a  
>> bit.
>>   
>> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=58927
>
> What you're doing is keeping an alternate, mutable reference to each  
> object. This does not mean that logical const == const.

No I'm not.  I'm keeping a portion of the object in a global AA.  I'm not  
storing a mutable reference to the object itself.

When you call a const function, *no data* that is defined within the data  
of the object is modified.  It is true logical const, not a hack (in  
contrast, the example I gave in this thread is a hack).

-Steve


More information about the Digitalmars-d mailing list