SysTutorials

Linux Manual Pages › Section 3

stdexperimentalshuffle(3)

std::experimental::shuffle - std::experimental::shuffle

Synopsis

Defined in header<experimental / algorithm>
    template <class RandomIt>
    (library fundamentals TS v2)
        void shuffle(RandomIt first, RandomIt last);

Reorders the elements in the given range [first, last) such that each possible permutation of those elements has equal probability of appearance, using the per-thread_random_number_engine as the random number generator.

Parameters

first, last - the range of elements to shuffle randomly

RandomIt must meet the requirements of ValueSwappable and LegacyRandomAccessIterator.

Return value

(none)

Complexity

Linear in the distance between first and last.

Example

 This section is incomplete  Reason: no example

See also

random_shuffle shuffle randomly re-orders elements in a range                (function template) (until C++17) (C++11)