chooseAmong

fnauto chooseAmong(Ranges...)(size_t index, return scope Ranges rs) if (Ranges.length >= 2 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap!(ElementType, Ranges)) == void))

Choose one of multiple ranges at runtime.

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

indexwhich range to choose, must be less than the number of ranges
rstwo 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.