Summary: Variadic templates do not work properly with default
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrej Mitrovic <> 2012-09-18 
09:09:36 PDT ---
A simplified version of std.range.lockstep:

auto newLockstep(Args...)(Args args, StoppingPolicy stoppingPolicy =
     // ...

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:
------- You are receiving this mail because: -------

Reply via email to