std::size_t size() const noexcept; | (since C++11) |
Returns the size of the stored initial seed sequence.
(none).
The size of the private container that was populated at construction time.
Constant time.
#include <iostream>
#include <random>
int main()
{
std::seed_seq s1 = {-1, 0, 1};
std::cout << s1.size() << '\n';
}Output:
3
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 required to be noexcept | required |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/numeric/random/seed_seq/size