Alias lamda argument vs Type template argument

Freddy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 15 20:02:29 PDT 2015


There are two these different ways to pass functions as template 
arguments. Which is preferred?
---
void funcA(alias calle)()
{
     calle();
}

void funcB(T)(T calle)
{
     calle();
}

void main()
{
     funcA!(() => 0);
     funcB(() => 0);
}
---


More information about the Digitalmars-d-learn mailing list