absl::Uniform

Produces random values of type T uniformly distributed in [lo, hi).]

Synopsis

Declared in <absl/random/distributions.h>

template<
    typename R = void,
    typename URBG>
R
Uniform(
    URBG&& urbg,
    R lo,
    R hi)
requires !std::is_same_v<R, void>;

Description

Overload of Uniform() using the default closed-open interval of [lo, hi),] and returning values of type T.

Return Value

A random value uniformly distributed in [lo, hi).]

Parameters

NameDescription
urbgThe uniform random bit generator.
loThe inclusive lower bound of the interval.
hiThe exclusive upper bound of the interval.