eliminating std.range.SListRange?

bearophile bearophileHUGS at lycos.com
Sun May 30 16:00:59 PDT 2010


Andrei Alexandrescu:
> Sounds good.

I'd like a single linked one, and a double linked one (but in my opinion in modern programming linked lists are uncommon. In most situations dynamic arrays are better).


> The heap is a tad difficult to tackle. Most of the time you don't want 
> to create a heap, but instead to organize an existing range as a heap. 
> As such, the heap is not always obvious to think of as a container. I'm 
> undecided on how to approach this.

As usual some pieces of Reality don't perfectly fit our categories :-)
A collection is something able to hold/keep many items. A heap is a data structure, it's one specific organization of data.
They are two different things, it's like the difference between an "array" and a "sorted array", they are two different data structures (because you can't append randomly in the second one), but they are represented with the same collection.
You can map one data structure on different collections.
A "heap struct" (as the one in std.algorithm) is not an algorithm, so std.algorithm is not the right place for it, so it's better to move it elsewhere.

Bye,
bearophile


More information about the Digitalmars-d mailing list