std::seed_seq::param
From cppreference.com
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) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saturation arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Pseudo-random number generation
|
|
std::seed_seq
Member functions | ||||
seed_seq::param |
template
<
class OutputIt >
void param( OutputIt dest ) const ; |
(since C++11) | |
Copies the stored seeds to the range beginning with dest. Equivalent to
std::copy(
v
.begin(),
v
.end(), dest);
If values of type result_type
are not writable to dest
If OutputIt
does not satisfy the requirements of LegacyOutputIterator
Parameters
dest | - | the beginning iterator of the output range |
Exceptions
Only throws the exceptions thrown by the operations on dest.
Example
Run this code
#include <iostream> #include <iterator> #include <random> int main() { std::seed_seq s1 = {-1, 0, 1}; s1.param(std::ostream_iterator<int>(std::cout, " ")); }
Output:
-1 0 1
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 2180 | C++11 | seed_seq::param is non-throwing
|
it may throw exceptions |