Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

Rob T rob at ucora.com
Thu Nov 8 15:46:29 PST 2012


On Thursday, 8 November 2012 at 23:05:33 UTC, Nick Sabalausky 
wrote:
> Most of big glaring problems have been fixed since then, but
> unfortunately there's still a number of edge cases yet to be 
> ironed out.

Clearly.

> FWIW, you should be able to work around the issue by making 
> some of the
> pointers "void*". You'll lose some type safety and have to 
> remember to
> cast things correctly, but it should at least make it compile 
> (although
> I haven't tried it).

The T* pointers don't seem to be the problem, it's the T payload. 
If I switch to T* payload it all works OK, but I'll have to 
perform allocations on each instance of payload which is not 
desirable. I may still get away with it in my case, but I'm very 
concerned that it will start eating up memory needlessly because 
the GC appears to come with a ton of issues yet to be resolved.

--rt



More information about the Digitalmars-d-learn mailing list