cpp/experimental/sample

Selects elements from the sequence $[first; last)$ such that each possible sample has equal probability of appearance, and writes those selected elements into the output iterator

If is greater than the number of elements in the sequence, selects  elements.

The algorithm is stable only if meets the requirements of

@1@ Random numbers are generated using the random number generator. @2@ Random numbers are generated using the per-thread engine.

Return value
Returns a copy of after the last sample that was output, that is, end of the sample range.

Complexity
Linear in