Get specific item by index from DList

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 22 15:44:17 PDT 2016


On Wed, Jun 22, 2016 at 10:25:21PM +0000, lmpo via Digitalmars-d-learn wrote:
> On Wednesday, 22 June 2016 at 22:10:09 UTC, TheDGuy wrote:
> > Hi,
> > 
> > i am currently programming a small game with GTKD and i have to use
> > a Dlist because an array is static
> 
> Static ? An array is not static. a DList is only interesting when you
> have to insert or remove inside the list i.e not at the back. If the
> container grows always from the back than you should rather use an
> array.

Yes, and arrays also have better cache coherence, and if your elements
are small, using a DList will perform poorly due to poor locality.


T

-- 
Doubt is a self-fulfilling prophecy.


More information about the Digitalmars-d-learn mailing list