View source code
							
							
						
								Display the source code in std/range/package.d from which thispage was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create aBugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.
							
						Function std.range.roundRobin
roundRobin(r1, r2, r3) yields r1, then r2,
then r3, after which it pops off one element from each and
continues again from r1. For example, if two ranges are involved,
it alternately yields elements off the two ranges. roundRobin
stops after it has consumed all ranges (skipping over the ones that
finish early).
						
				auto roundRobin(Rs...)(
				
  Rs rs
				
				)
				
				if (Rs
				Example
import stdExample
roundRobin can be used to create "interleave" functionality which inserts an element between each element in a range.
import stdAuthors
Andrei Alexandrescu, David Simcha, Jonathan M Davis, and Jack Stouffer. Credit for some of the ideas in building this module goes to Leonardo Maffi.
License
					Copyright © 1999-2025 by the D Language Foundation | Page generated by ddox.