Feature Request: Linked Arrays
BLS
nanali at nospam-wanadoo.fr
Wed May 7 08:46:39 PDT 2008
downs schrieb:
> Since one of D's weaknesses is bad speed when appending to dynamic arrays, I've been thinking about a way to fix this.
>
> Linked arrays are a hybrid between flat arrays and linked list: a single linked list of array chunks.
So it would be nice to have a datastructure that is a mixture of a
<Vector> and a <LinkedList>.
A list-implementation that
automatically handles allocation of needed space quite efficiently,
provides fast index-based access *and* fast insertions and removals.
List.d tries to behave like a <Vector> and thus like a
dynamic array if possible:
if T.sizeof <= (void*).sizeof
behave like vector
else
behave circular linked list // to solve the head tail problem
I think it is worth to have a look at Uwe Salomons list implementation.
dsource indigo/tools/list.d
based on :
http://doc.trolltech.com/4.0/qlist.html
Bjoern
More information about the Digitalmars-d
mailing list