Is instantiabilty of templated types decidable?

Peter Alexander peter.alexander.au at gmail.com
Sun Nov 11 04:49:31 PST 2012


On Sunday, 11 November 2012 at 12:33:25 UTC, Manfred Nowak wrote:
> a) Instantiability is decidable
> Why does the compiler stop with the evaluation at that randomly
> choosen and apparently hard coded value of 500 recursive
> expansions?

It's not decidable. Consider use of static if. It's Turing 
complete. I can give an example if you like.


> b) Instantiability is not decidable
> Why does the compiler even try to instantiate more than the
> indeed needed type `Elem!0'?
>
> I miss the rationale for this behaviour.

As David says, it's needed for TypeInfo etc.



More information about the Digitalmars-d mailing list