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

Name

Description

c

The container whose elements to shuffle.

gen

The uniform random bit generator driving the shuffle.

Created with MrDocs