On Friday, 27 June 2014 at 23:30:39 UTC, safety0ff wrote:
2) With regard to reducing template instantiations:
I've been using a technique similar to the one mentioned in the
video: separating functions out of templates to reduce bloat.
My question is: does a template such as:
T foo(T)(T x)
if (isIntegral!T) { return x; }
Get instantiated multiple times for const, immutable, etc.
qualifiers on the input?
Yes, but bear in mind that those qualifiers are often stripped
with IFTI, e.g.:
int a;
const int b;
immutable int c;
foo(a);
foo(b);
foo(c);
These all call foo!int