Suggestion: dynamic array operations

Sean Kelly sean at f4.ca
Thu Sep 7 08:52:23 PDT 2006


Steve Horne wrote:
> 
> But I still think there should be alternative containers in the
> library (assuming they're not there anyway and I've just missed them).
> I know the term 'perfect hash', but the term is precisely that - not
> 'perfect container'! There are things that hashtables can't do (or at
> least, can't do very efficiently for large datasets) like in-order
> iterating or picking out an ordered subrange.

Definitely.  I'm mostly supporting arrays at the moment because they're 
built-in, and I haven't seen a container library for D yet that I'm 
convinced is the perfect solution.  But eventually, I'd like to revert 
to an iterator sort of approach instead.  Oskar mentioned recently that 
we can sort of do that now by supporting anything with opIndex and a 
length property, but I'm not sure I see a tremendous value there over 
arrays--largely because I can't think of many objects I'd implement with 
these methods that I'd want to run algorithms on.


Sean



More information about the Digitalmars-d mailing list