digitalmars.D - Representation of a tree
Hello,
I want to represent a tree node in D. I think if struct works for
it:
struct Node {
Node* l, r;
}
But can I use pointers? Will GC treat them properly? I'm leaning
to think it should be okay.
Jul 04 2014
On Friday, 4 July 2014 at 19:13:28 UTC, Igor wrote:
Hello,
I want to represent a tree node in D. I think if struct works
for it:
struct Node {
Node* l, r;
}
But can I use pointers? Will GC treat them properly? I'm
leaning to think it should be okay.
Yes, in fact that's how it's done in phobos:
https://github.com/D-Programming-Language/phobos/blob/master/std/container/dlist.d#L11
Jul 04 2014








"safety0ff" <safety0ff.dev gmail.com>