How to declare a parameterized recursive data structure?

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 15 11:43:46 PDT 2014


artemav:

> struct node(T) {
>     T data;
>     node!T next;
> };

Try:

struct node(T) {
     T data;
     node!T* next;
}

Bye,
bearophile


More information about the Digitalmars-d mailing list