std::independent_bits_engine
来自 cppreference.cn
定义于头文件 <random> |
||
template< class Engine, |
(始于 C++11) | |
independent_bits_engine
是一个随机数引擎适配器,它生成的随机数的位数与被包装的引擎不同。
目录 |
[编辑] 模板参数
Engine | - | 被包装的引擎的类型 |
W | - | 生成的数字应具有的位数 |
UIntType | - | 生成的随机数的类型。除非参数是 cv 限定的,并且是 unsigned short, unsigned int, unsigned long, 或 unsigned long long 之一,否则效果未定义。 |
类型要求 | ||
-Engine 必须满足 RandomNumberEngine 的要求。 | ||
-W 必须大于零,且不大于 std::numeric_limits<UIntType>::digits。 |
[编辑] 成员类型
成员类型 | 定义 |
result_type (C++11) |
UIntType
|
[编辑] 成员函数
(C++11) |
构造引擎适配器 (public member function) |
(C++11) |
设置底层引擎的状态 (public member function) |
(C++11) |
返回底层引擎 (public member function) |
生成 | |
(C++11) |
推进底层引擎的状态并返回生成的值 (public member function) |
(C++11) |
按指定的量推进适配器的状态 (public member function) |
特性 | |
[static] (C++11) |
获取输出范围内最小的可能值(始终为零)。 (public static member function) |
[static] (C++11) |
获取输出范围内最大的可能值(始终为 2w - 1)。 (public static member function) |
[编辑] 非成员函数
(C++11)(C++11)(移除于 C++20) |
比较适配器和底层引擎的内部状态 (function) |
(C++11) |
对伪随机数引擎适配器执行流输入和输出 (function) |
[编辑] 示例
本节不完整 原因:没有示例 |