std::shuffle_order_engine<Engine,K>:: shuffle_order_engine
From cppreference.net
<
cpp
|
numeric
|
random
|
shuffle order engine
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data-parallel types (SIMD) (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pseudo-random number generation
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::shuffle_order_engine
| Member functions | ||||
|
shuffle_order_engine::shuffle_order_engine
|
||||
| Generation | ||||
| Characteristics | ||||
| Non-member functions | ||||
|
(C++11)
(C++11)
(until C++20)
|
||||
|
(C++11)
(C++11)
|
|
shuffle_order_engine
(
)
;
|
(1) | (自 C++11 起) |
|
explicit
shuffle_order_engine
(
result_type s
)
;
|
(2) | (自 C++11 起) |
|
template
<
class
SeedSeq
>
explicit shuffle_order_engine ( SeedSeq & seq ) ; |
(3) | (自 C++11 起) |
|
explicit
shuffle_order_engine
(
const
Engine
&
e
)
;
|
(4) | (自 C++11 起) |
|
explicit
shuffle_order_engine
(
Engine
&&
e
)
;
|
(5) | (自 C++11 起) |
构造新的伪随机引擎适配器。
1)
默认构造函数。底层引擎亦采用默认构造。
2)
使用
s
构造底层引擎。
3)
使用种子序列
seq
构造底层引擎。
4)
使用
e
的副本构造底层引擎。
5)
使用
e
移动构造底层引擎。此后
e
保持未指定但有效的状态。
目录 |
参数
| s | - | 用于构造底层引擎的整数值 |
| seq | - | 用于构造底层引擎的种子序列 |
| e | - | 用于初始化的伪随机数引擎 |
异常
示例
缺陷报告
以下行为变更缺陷报告被追溯应用于先前发布的C++标准。
| 缺陷报告 | 应用于 | 发布时行为 | 正确行为 |
|---|---|---|---|
| LWG 2181 | C++11 |
重载
(
3
)
即使
seq.generate
调用抛出异常也不会抛出
|
传播该异常 |