How to declare a parameterized recursive data structure?

safety0ff via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 16 15:55:36 PDT 2014


On Saturday, 16 August 2014 at 17:55:28 UTC, Gary Willoughby
wrote:
>
> Funnily enough i've been toying with linked lists using the 
> same kind of nodes here:
> https://github.com/nomad-software/etcetera/blob/master/source/etcetera/collection/linkedlist.d
>
> Might be of use to you?

Why did you put the data between the two pointers?

I would put the pointers side-by-side in memory:

- The two pointers will be in the same cache line no matter which
type T is used.
- It should reduce the amount of padding in the Node struct.


More information about the Digitalmars-d mailing list