std::seed_seq::size
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Numerics library
Interpolations
Generic numeric operations
C-style checked integer arithmetic
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)
Bit manipulation (C++20)
Saturation arithmetic (C++26)
(C++17)
(C++17)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++26)
Pseudo-random number generation
(C++20)
(C++11)
(C++11)
(C++11)
(C++26)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++26)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
std::size_t size() const noexcept;
(since C++11)
Returns the size of the underlying seed sequence.
[edit] Return value
v
.size()
[edit] Complexity
Constant time.
[edit] Example
Run this code
#include <iostream> #include <random> int main() { std::seed_seq s1 = {-1, 0, 1}; std::cout << s1.size() << '\n'; }
Output:
3
[edit] 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 |