On Monday, 17 April 2017 at 14:23:50 UTC, Jonathan M Davis wrote:
On Monday, April 17, 2017 13:45:18 Dmitry via Digitalmars-d-learn wrote:
[...]

Every time there's a new template instantiation, it's essentially copy-pasting the entire template. So, if you have the templated function

[...]

The other reason to avoid excessive template instantiation is that it inflates your compile time. A while back I changed my custom assertf() and logf() functions to be non-templated in exactly the way Jonathan M Davis described, and it shaved ~0.5s off my 3s build time. This particular project is currently only 8000 LOC, but on a larger project you can see the hit could be pretty significant.

Reply via email to