On Saturday, 12 September 2015 at 10:17:19 UTC, Nordlöw wrote:
How do I most elegantly iterate all the adjacent pairs in an `InputRange` using Phobos?Something like [1,2,3,4] => [(1,2), (2,3), (3,4)]
Why not just: zip(arr[0 .. $-1], arr[1 .. $]) ?
On Saturday, 12 September 2015 at 10:17:19 UTC, Nordlöw wrote:
How do I most elegantly iterate all the adjacent pairs in an `InputRange` using Phobos?Something like [1,2,3,4] => [(1,2), (2,3), (3,4)]
Why not just: zip(arr[0 .. $-1], arr[1 .. $]) ?