Skip to content

Commit 7386c79

Browse files
authored
Merge pull request #4669 from JackStouffer/patch-15
[trivial] Improved docs for std.range.zip
2 parents 1c2632e + c00e298 commit 7386c79

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

std/range/package.d

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3759,11 +3759,18 @@ private alias lengthType(R) = typeof(R.init.length.init);
37593759
`lockstep` allows reference access to the elements in
37603760
`foreach` iterations.
37613761
3762-
$(D Zip) offers the lowest range facilities of all components, e.g. it
3763-
offers random access iff all ranges offer random access, and also
3764-
offers mutation and swapping if all ranges offer it. Due to this, $(D
3765-
Zip) is extremely powerful because it allows manipulating several
3766-
ranges in lockstep.
3762+
Params:
3763+
sp = controls what `zip` will do if the _ranges are different lengths
3764+
ranges = the ranges to zip together
3765+
Returns:
3766+
At minimum, an input range. `Zip` offers the lowest range facilities
3767+
of all components, e.g. it offers random access iff all ranges offer
3768+
random access, and also offers mutation and swapping if all ranges offer
3769+
it. Due to this, `Zip` is extremely powerful because it allows manipulating
3770+
several ranges in lockstep.
3771+
Throws:
3772+
An `Exception` if all of the _ranges are not the same length and
3773+
`sp` is set to `StoppingPolicy.requireSameLength`.
37673774
*/
37683775
struct Zip(Ranges...)
37693776
if (Ranges.length && allSatisfy!(isInputRange, Ranges))

0 commit comments

Comments
 (0)