Skip to content

Commit

Permalink
Improved docs for std.range.zip
Browse files Browse the repository at this point in the history
  • Loading branch information
JackStouffer authored Jul 27, 2016
1 parent 52b6945 commit c00e298
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 c00e298

Please sign in to comment.