Skip to content

Commit

Permalink
Merge pull request #4669 from JackStouffer/patch-15
Browse files Browse the repository at this point in the history
[trivial] Improved docs for std.range.zip
  • Loading branch information
WalterBright authored Jul 28, 2016
2 parents 1c2632e + c00e298 commit 7386c79
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions std/range/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7386c79

Please sign in to comment.