On Thursday, 9 October 2014 at 19:04:56 UTC, Anibal wrote:
Hi everyone,
I'm trying to something like a tree structure.
The following:
import std.container;
class Tree
{
private SList!Tree subTree;
}
Produces: class Tree no size yet for forward reference.
How i should proceed in order to keep this declaration?
Thanks a lot!
PD: (You guys are incredibly quick to answer, that's awesome!)
make a pointer list instead, which has a fixed size:
---
import std.container;
class Tree
{
private SList!(Tree*) subTree;
}
---