http://d.puremagic.com/issues/show_bug.cgi?id=8687
Summary: Variadic templates do not work properly with default arguments Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-09-18 09:09:36 PDT --- A simplified version of std.range.lockstep: auto newLockstep(Args...)(Args args, StoppingPolicy stoppingPolicy = StoppingPolicy.shortest) { // ... } However it doesn't work: foreach (x, y; newLockstep([1, 2], [1, 2])) { } test.d(32): Error: template test.newLockstep does not match any function template declaration test.d(14): Error: template test.newLockstep(Args...) if (allSatisfy!(isInputRange,staticMap!(Unqual,Args))) cannot deduce template function from argument types !()(int[],int[]) Passing an argument in place of the default explicitly does work: foreach (x, y; newLockstep([1, 2], [1, 2], StoppingPolicy.shortest)) { } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------