https://issues.dlang.org/show_bug.cgi?id=6788
--- Comment #11 from bearophile_h...@eml.cc --- (In reply to bearophile_hugs from comment #10) > .pairwise!2 pairwise takes only one argument sequence, so that comment was bad. The template argument is used to denote how many items you want in your "pairs" (where 2 is the default). So: [1, 2, 3, 4].pairwise Or: [1, 2, 3, 4].pairwise!2 should yield: (1, 2) (1, 3) (1, 4) (2, 3) (2, 4) (3, 4) [1, 2, 3, 4].pairwise!3 should yield: (1, 2, 3) (1, 2, 4) (1, 3, 4) (2, 3, 4) Like in this lower level code: void main() { import std.stdio, std.range, std.algorithm; auto a = [1, 2, 3, 4]; foreach (immutable i; 0 .. a.length) foreach (immutable j; i + 1 .. a.length) writefln("(%d, %d)", a[i], a[j]); writeln; foreach (immutable i; 0 .. a.length) foreach (immutable j; i + 1 .. a.length) foreach (immutable k; j + 1 .. a.length) writefln("(%d, %d, %d)", a[i], a[j], a[k]); } --