digitalmars.D.bugs - [Issue 16345] New: lazy variadic function in template with default
- via Digitalmars-d-bugs (35/35) Aug 01 2016 https://issues.dlang.org/show_bug.cgi?id=16345
https://issues.dlang.org/show_bug.cgi?id=16345 Issue ID: 16345 Summary: lazy variadic function in template with default value cannot be deduced Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: minor Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: kroeplin.d googlemail.com The following code does not compile: void all(string file = __FILE__, size_t line = __LINE__)(void delegate()[] dgs ...) { foreach (dg; dgs) { dg(); } } void main() { all( assert(true), ); } Error: template all cannot deduce function from argument types !()(void), candidates are: all(string file = __FILE__, ulong line = __LINE__)(void delegate()[] dgs...) Workaround: call `all!()(...)` instead of `all(...)`. --
Aug 01 2016