[OT] Finding longest documents

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 14 18:45:30 PDT 2008


Benji Smith wrote:
> Andrei Alexandrescu wrote:
>> Christopher Wright wrote:
>>> Actually, I STRONGLY urge that nobody use this heap.
>>>
>>> It's a struct. If you access it by value and append to it, then 
>>> access it from any other alias, you will erase a random element from 
>>> the heap.
>>>
>>> If it were a class, this would not be possible. As I implemented it, 
>>> it would not be possible.
>>>
>>> Containers as value types is such an idiotic idea for precisely this 
>>> reason.
>>
>> I'd say this statement reflects a lack of understanding of value 
>> types, rather than value containers are an idiotic idea.
>>
>> Andrei
> 
> I'll bite.
> 
> Why is it a good idea that containers are implements as structs?

As the Mexican would say: why not?

Andrei



More information about the Digitalmars-d mailing list