std::uniform_int_distribution (3) - Linux Manuals
std::uniform_int_distribution: std::uniform_int_distribution
NAME
std::uniform_int_distribution - std::uniform_int_distribution
Synopsis
Defined in header <random>
template< class IntType = int > (since C++11)
class uniform_int_distribution;
Produces random integer values i, uniformly distributed on the closed interval [a, b], that is, distributed according to the discrete probability function
std::uniform_int_distribution satisfies all requirements of RandomNumberDistribution
Template parameters
IntType - The result type generated by the generator. The effect is undefined if this is not one of short, int, long, long long, unsigned short, unsigned int, unsigned long, or unsigned long long.
Member types
Member type Definition
result_type IntType
param_type the type of the parameter set, see RandomNumberDistribution.
Member functions
constructor (public member function)
reset (public member function)
Generation
operator() (public member function)
Characteristics
a (public member function)
b
param (public member function)
min (public member function)
max (public member function)
Non-member functions
operator== (function)
operator!=
operator<< (function template)
operator>>
Example
This program simulates throwing 6-sided dice.
// Run this code
Possible output: