...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::uniform_int
// In header: <boost/random/uniform_int.hpp> template<typename IntType = int> class uniform_int { public: // types typedef IntType input_type; typedef IntType result_type; // construct/copy/destruct uniform_int(IntType = 0, IntType = 9); // public member functions result_type min() const; result_type max() const; void reset(); template<typename Engine> result_type operator()(Engine &); template<typename Engine> result_type operator()(Engine &, result_type); };
The distribution function uniform_int models a random distribution . On each invocation, it returns a random integer value uniformly distributed in the set of integer numbers {min, min+1, min+2, ..., max}.
The template parameter IntType shall denote an integer-like value type.
uniform_int
public member functionsresult_type min() const;
Returns: The "min" parameter of the distribution
result_type max() const;
Returns: The "max" parameter of the distribution
void reset();
template<typename Engine> result_type operator()(Engine & eng);
template<typename Engine> result_type operator()(Engine & eng, result_type n);