std::seed_seq:: size
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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saturation arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bit operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pseudo-random number generation
|
|
std::seed_seq
Member functions | ||||
seed_seq::size
|
||||
std::
size_t
size
(
)
const
noexcept
;
|
(since C++11) | |
Returns the size of the underlying seed sequence.
Return value
v
.
size
(
)
Complexity
Constant time.
Example
Run this code
#include <iostream> #include <random> int main() { std::seed_seq s1 = {-1, 0, 1}; std::cout << s1.size() << '\n'; }
Output:
3
Defect report
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 2440 | C++11 |
seed_seq::size
was not noexcept
|
made noexcept |
Retrieved from "
https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random/seed_seq/size&oldid=177244
"