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

Name

Description

urbg

The uniform random bit generator.

lo

The inclusive lower bound of the interval.

hi

The exclusive upper bound of the interval.

Created with MrDocs