On Thursday, 17 December 2020 at 21:24:40 UTC, FreeSlave wrote:
On Thursday, 17 December 2020 at 19:45:38 UTC, Dave P. wrote:
[...]

Something like that?

import  std.stdio;

void print_int(alias n)()
{
    writeln(n.stringof~"=", n);
}

void main()
{
    int x = 42;
    print_int!(x);
    print_int!(7);
}

Very cool! Where can I read about what an alias as a template parameter does?

Reply via email to