This distribution produces random integer values uniformly distributed in the closed (inclusive) interval [a, b].

Synopsis

Declared in <absl/random/uniform_int_distribution.h>

template<typename IntType = int>
class uniform_int_distribution;

Description

Example:

absl::BitGen gen;

// Use the distribution to produce a value between 1 and 6, inclusive. int die_roll = absl::uniform_int_distribution<int>(1, 6)(gen);

Types

Name

Description

param_type

The parameter set of the distribution.

Type Aliases

Name

Description

result_type

The type of the values produced by the distribution.

Member Functions

Name

Description

uniform_int_distribution [constructor]

Constructors

a

Returns the lower bound of the interval.

b

Returns the upper bound of the interval.

max

Returns the largest value the distribution can produce.

min

Returns the smallest value the distribution can produce.

operator()

Function call operators

param

param overloads

reset

Resets the uniform int distribution.

Friends

Name

Description

absl::operator!=

Compares two distributions for inequality.

absl::operator==

Compares two distributions for equality.

Created with MrDocs