Caching of Template Instantiations

2015-10-17 Thread Nordlöw via Digitalmars-d-learn
Does DMD cache template instantiations? That is, is it preferred to do, for instance, either static if (isIntegral!T && isUnsigned!(T)) {} else static if (isIntegral!T && isSigned!(T)) {} or enum integral = isIntegral!T; static if (integral && isUnsigned!(T)) {} e

Re: Caching of Template Instantiations

2015-10-17 Thread Marc Schütz via Digitalmars-d-learn
On Saturday, 17 October 2015 at 07:48:39 UTC, Nordlöw wrote: Does DMD cache template instantiations? Yes, and it's required by the spec: "Multiple instantiations of a TemplateDeclaration with the same TemplateArgumentList all will refer to the same instantiation." http://dlang.org/template.h