Make function alias

Andrey saasecondbox at yandex.ru
Mon Aug 20 13:14:14 UTC 2018


Hello,
I want to make an alias to function "std.stdio.writeln" and 
"std.stdio.write" and use it like:

>static void log(bool newline = true)(string text)
>{
>    alias print(T...) = newline ? &writeln : &write;
> 
>    _file.print();
>    text.print();
>}

Unfortunately, it doesn't work... Also tried with "enum print 
..." but also no success.
How to do it correctly?


More information about the Digitalmars-d-learn mailing list