On 2/7/2017 7:00 AM, Andrea Fontana wrote:
I don't understand why we can't use a template like:auto fun_time(SysTime)(SysTime tm) { import std.datetime; static assert (is(SysTime == std.datetime.SysTime)); return tm; } void main() { import std.stdio; import std.datetime; fun_time(Clock.currTime()).writeln; }
It's an interesting idea, but it will have problems with overloading, as the template selection will match on everything.
