Namespaces
Variants
Actions

std::seed_seq::size

From cppreference.com
< cpp‎ | numeric‎ | random‎ | seed seq
 
C++
 
Numerics library
 
Pseudo-random number generation
 
std::seed_seq
 
std::size_t size() const noexcept;
(since C++11)

Returns the size of the underlying seed sequence.

Contents

[edit] Return value

v .size()

[edit] Complexity

Constant time.

[edit] Example

#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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant