View source code
							
							
						
								Display the source code in std/range/package.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla 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 using
								local clone.
							
						Function std.range.chooseAmong
Choose one of multiple ranges at runtime.
						
				auto auto chooseAmong(Ranges...)
				(
				
				  size_t index,
				
				  Ranges rs
				
				)
				
				if (Ranges
				The ranges may be different, but they must have compatible element types. The
result is a range that offers the weakest capabilities of all Ranges.
Parameters
| Name | Description | 
|---|---|
| index | which range to choose, must be less than the number of ranges | 
| rs | two or more ranges | 
Returns
The indexed range. If rs consists of only one range, the return type is an alias of that range's type.
Example
auto test()
{
    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-2022 by the D Language Foundation | Page generated by ddox.