[OT] Finding longest documents

Christopher Wright dhasenan at gmail.com
Tue Oct 14 17:35:05 PDT 2008


Christopher Wright 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.
> 
> Correction: as partial value types. If they were completely value types, 
> it'd be stupid for a much different reason -- namely, that they're very 
> difficult to resize. But this class of bugs would not be an issue.

Argh, I'm making more of an idiot of myself. If they're value types by 
merit of being entirely on the stack, yes. If they're value types by 
merit of the behavior of assignment, then I'm full of crap and you 
should pay me no mind.



More information about the Digitalmars-d mailing list