From c00e298ef68d3c865548c7c5bd77d65e80cc41f6 Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Wed, 27 Jul 2016 15:40:26 -0400 Subject: [PATCH] Improved docs for std.range.zip --- std/range/package.d | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/std/range/package.d b/std/range/package.d index 3717c197d..13c2f4307 100644 --- a/std/range/package.d +++ b/std/range/package.d @@ -3759,11 +3759,18 @@ private alias lengthType(R) = typeof(R.init.length.init); `lockstep` allows reference access to the elements in `foreach` iterations. - $(D Zip) offers the lowest range facilities of all components, e.g. it - offers random access iff all ranges offer random access, and also - offers mutation and swapping if all ranges offer it. Due to this, $(D - Zip) is extremely powerful because it allows manipulating several - ranges in lockstep. + Params: + sp = controls what `zip` will do if the _ranges are different lengths + ranges = the ranges to zip together + Returns: + At minimum, an input range. `Zip` offers the lowest range facilities + of all components, e.g. it offers random access iff all ranges offer + random access, and also offers mutation and swapping if all ranges offer + it. Due to this, `Zip` is extremely powerful because it allows manipulating + several ranges in lockstep. + Throws: + An `Exception` if all of the _ranges are not the same length and + `sp` is set to `StoppingPolicy.requireSameLength`. */ struct Zip(Ranges...) if (Ranges.length && allSatisfy!(isInputRange, Ranges))