```
template<class PopulationIterator, class SampleIterator,
class Distance, class UniformRandomBitGenerator>
SampleIterator sample(PopulationIterator first, PopulationIterator last,
SampleIterator out, Distance n,
UniformRandomBitGenerator&& g);
```

Requires:

- SampleIterator shall satisfy the Cpp17RandomAccessIterator requirements ([random.access.iterators]) unless PopulationIterator satisfies the Cpp17ForwardIterator requirements ([forward.iterators]).
- Distance shall be an integer type.
- remove_reference_t<UniformRandomBitGenerator> shall satisfy the requirements of a uniform random bit generator type ([rand.req.urng]) whose return type is convertible to Distance.

Effects:
Copies elements (the *sample*)
from [first, last) (the *population*) to out
such that each possible sample has equal probability of appearance.