生成一个统一整数分布。保留为TR1兼容性。请改用 uniform_int_distribution Class。
template<class IntType = int>
class uniform_int {
public:
typedef IntType input_type;
typedef IntType result_type;
explicit uniform_int(result_type min0 = 0, result_type max0 = 9);
result_type min() const;
result_type max() const;
void reset();
template<class Engine>
result_type operator()(Engine& eng);
template<class Engine>
result_type operator()(Engine& eng, result_type n);
private:
result_type stored_min; // exposition only
result_type stored_max; // exposition only
};
参数
- IntType
整数结果类型。
备注
模板选件类描述导致一个用户指定的整型值与一个统一分发的分发。
要求
标头: <random>
命名空间: std