Recursive expansion

Jonathan M Davis jmdavisProg at gmx.com
Fri Aug 17 15:01:31 PDT 2012


On Friday, August 17, 2012 23:45:49 Henning Pohl wrote:
> I've ended up with a TypeTuple storing 1230 auto-generated types.
> Now the compiler claims there is a recursive template expansion.
> How to stir him from his resolve?

I believe that if a particular template is ever instantiated more than 50 
times recursively, the compiler will error out on the assumption that it's hit 
infinite recursion (it has to bottom out eventually, or would just end up 
running until it ran out of memory if it actually does hit infinite recursion; 
I don't know how arbitrary the choice of 50 was). So, the TypeTuple itself 
shouldn't be a problem (e.g. you should be able to use foreach on it just 
fine), but template instantiations will be a problem if you try and go through 
the whole TypeTuple recursively.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list