std::seed_seq::size

From cppreference.com
< cpp‎ | numeric‎ | random‎ | seed seq
 
 
 
Pseudo-random number generation
Uniform random bit generators
Engines and engine adaptors
Non-deterministic generator
Distributions
Uniform distributions
Bernoulli distributions
Poisson distributions
Normal distributions
Sampling distributions
Seed Sequences
(C++11)
C library
 
std::seed_seq
Member functions
seed_seq::size
(C++11)
 
std::size_t size() const noexcept;
(since C++11)

Returns the size of the stored initial seed sequence.

Parameters

(none)

Return value

The size of the private container that was populated at construction time.

Complexity

Constant time.

Example

#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 required to be noexcept required