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

Timon Gehr timon.gehr at gmx.ch
Sat Nov 10 08:19:07 PST 2012


On 11/10/2012 10:12 AM, Manfred Nowak wrote:
> Timon Gehr wrote:
>
>> In theory yes, but
> [...]
>
> What a pity. Because in the code given only the types Elem!0 and Elem!1
> must be indeed initialized.
> ...

In this specific case, yes. But as this is an undecidable property in 
general, detecting and exploiting it would merely be an optimization 
that cannot generally be relied upon. Depending on how powerful it is, 
it would slow down analysis most of the time. Furthermore, I do not see 
use cases. I'll look into it when the front end is finished though.



More information about the Digitalmars-d-learn mailing list