range. If it can, it will
return a ref to the range element, otherwise it will return a copy.
auto ref choice(Range, RandomGen = Random)(Range range, ref RandomGen urng) if (isRandomAccessRange!Range && hasLength!Range && isUniformRNG!RandomGen)Returns a random, uniformly chosen, element e from the supplied
Range range. If no random number generator is passed, the default
rndGen is used.
range | a random access range that has the length property defined |
urng | (optional) random number generator to use; if not specified, defaults to rndGen |
range. If it can, it will
return a ref to the range element, otherwise it will return a copy.