How to declare a parameterized recursive data structure?
Gary Willoughby via Digitalmars-d
digitalmars-d at puremagic.com
Sun Aug 17 02:46:05 PDT 2014
On Saturday, 16 August 2014 at 22:55:37 UTC, safety0ff wrote:
> 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.
Good idea, I didn't think about that.
More information about the Digitalmars-d
mailing list