zipWith

Zip ranges together with operation fun.

TODO Remove when Issue 8715 is fixed providing zipWith

  1. auto zipWith(Ranges ranges)
    zipWith
    (
    alias fun
    Ranges...
    )
    (
    Ranges ranges
    )
    if (
    Ranges.length >= 2 &&
    allSatisfy!(isInputRange, Ranges)
    )
  2. auto zipWith(StoppingPolicy sp, Ranges ranges)

Examples

auto x = [1, 2, 3];
import std.array: array;
assert(zipWith!`a+b`(x, x).array == [2, 4, 6]);
assert(zipWith!((a, b) => a + b)(x, x).array == [2, 4, 6]);
assert(zipWith!`a+b+c`(x, x, x).array == [3, 6, 9]);

Meta