most non-function templates could be advantageously replaced by function templates

Dicebot m.strashun at gmail.com
Tue May 14 01:27:38 PDT 2013


On Tuesday, 14 May 2013 at 06:56:23 UTC, Timothee Cour wrote:
> ...

My conclusion as well. Currently I follow simple rule when doing 
meta-programming in D:
     * If stuff returns type, make it a template and write in 
functional recursive flavor
     * If stuff returns data, make it a function (template 
function if needed) and just let CTFE do the magic.

One major advantage is that it helps to reduce template instance 
count and thus compiler memory consumption.


More information about the Digitalmars-d mailing list