Inability to dup/~ for const arrays of class objects

monarch_dodra monarchdodra at gmail.com
Wed May 29 02:44:28 PDT 2013


On Wednesday, 29 May 2013 at 09:40:08 UTC, monarch_dodra wrote:
> On Wednesday, 29 May 2013 at 01:05:14 UTC, Peter Williams wrote:
>> I'm implementing sets and the concept is sets of objects not 
>> sets of the values in the objects.  I want to be able to 
>> initialize sets using arrays and I'm promising that I won't 
>> change the array or its contents.
>> I'm also trying to promise that I won't (inside the set 
>> implementation) make any changes to individual objects.  But 
>> I'm not promising that they won't be changed by other code 
>> that has access to them.  The invariant (I wrote) for the sets 
>> implies that any changes made by that code can't change the 
>> sort order of the objects.
>>
>> Peter
>
> The problem is that you are missing a FUNDAMENTAL difference 
> between ...

Erm, I posted this without seeing there was more to the thread. 
So I could be wrong. But I think the point is still relevant.


More information about the Digitalmars-d mailing list