absl::c_shuffle

Container-based version of the <algorithm> std::shuffle() function to randomly shuffle elements within the container using a gen() uniform random number generator.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename RandomAccessContainer,
    typename UniformRandomBitGenerator>
void
c_shuffle(
    RandomAccessContainer& c,
    UniformRandomBitGenerator&& gen);

Parameters

NameDescription
cThe container whose elements to shuffle.
genThe uniform random bit generator driving the shuffle.