template<class PopulationIterator, class SampleIterator,
class Distance, class UniformRandomBitGenerator>
SampleIterator sample(PopulationIterator first, PopulationIterator last,
SampleIterator out, Distance n,
Copies min(last - first, n)
elements (the sample
from [first, last)
) to out
such that each possible sample has equal probability of appearance.
The end of the resulting sample range.
Stable if and only if PopulationIterator
requirements of a forward iterator.
To the extent that the implementation of this function makes use of
random numbers, the object g
shall serve as the
implementation's source of randomness.