Function template as template parameter

Andrey Zherikov andrey.zherikov at gmail.com
Sun Dec 11 09:43:34 UTC 2022


I have this (very simplified) code:
```d
void foo(alias callback)()
{
     callback!5;
}

static void print(int i)() { writeln(i); }
foo!print;
```

Is there a way to merge two last lines into one of a form like 
`foo!(...something...)`?

Note that callback parameter must be compile-time parameter as it 
represents a member of a type during introspection done by `foo`.


More information about the Digitalmars-d-learn mailing list