std::seed_seq::size(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

Okay so welcome to the <std::seed_seq::size> page from the C++ Standard Libary manual β€” yes bestie, that's the manual name, typo and all, and we are moving πŸ’…βœ¨

  • std::seed_seq::size β€” std::seed_seq::size, periodt. That's the whole name, no cap πŸ’–

πŸ“œ Synopsis πŸ“œ

std::size_t size() const noexcept;  (since C++11)

Returns the size of the stored initial seed sequence. Slay πŸ¦‹


🧚 Parameters 🧚

  • (none) β€” literally none, bestie. Nothing to pass, nothing to stress about 🫢

πŸ‘‘ Return value πŸ‘‘

The size of the private container that was populated at construction time. That's the whole vibe ✨


⚑ Complexity ⚑

Constant time. Iconic, lowkey effortless, no cap πŸ’…


🌸 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. History being messy, as usual 😭

  • DR: LWG 2440 Β· Applied to: C++11 Β· Behavior as published: seed_seq::size was not required to be noexcept Β· Correct behavior: required

Source: http://cppreference.com Β· version: 2024.06.10 Β· page: std::seed_seq::size(3) β€” mwah, that's the cute lil sign-off, bestie πŸ’‹πŸŽ€

πŸ“¦ where this page comes from