<experimental/algorithm> synopsis#include <algorithm>
namespace std::experimental::inline fundamentals_v3 {
template<class PopulationIterator, class SampleIterator, class Distance>
SampleIterator sample(PopulationIterator first, PopulationIterator last,
SampleIterator out, Distance n);
template<class RandomAccessIterator>
void shuffle(RandomAccessIterator first, RandomAccessIterator last);
} // namespace std::experimental::inline fundamentals_v3
return ::std::sample(first, last, out, n, g);
where g denotes
the per-thread engine (g serves as the
implementation’s source of randomness.
RandomAccessIterator meets the
[first,last)
such that each possible permutation of those elements has equal
probability of appearance.(last - first) - 1 swaps.