std::linear...engine::seed(3)

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

πŸ’… std::linear...engine::seed(3) β€” seeded bestie edition πŸ’…

okay so this page is std::linear...engine::seed(3) from the C++ Standard Libary manual, and we're here to set the state of a random-number engine. it's giving main-character energy ✨


🌸 NAME 🌸

std::linear_congruential_engine::seed β€” and the manual spells it out again as std::linear_congruential_engine::seed (yes bestie, same name twice, it's that iconic πŸ’…).

✨ Synopsis ✨

Two overloads, both since C++11, no cap:

void seed( result_type value = default_seed ); (1) (since C++11)
template< class SeedSeq >                      (2) (since C++11)
void seed( SeedSeq& seq );

Sets the state of the random-number engine. 🎲

  1. Right after the state is set, *this == std::linear_congruential_engine(value) is true. βœ…
  2. Right after the state is set, *this == std::linear_congruential_engine(seq) is true. βœ…

πŸŽ€ Parameters πŸŽ€

  • value β€” seed value to use to set the state.
  • seq β€” seed sequence to use to set the state.

😭 Exceptions 😭

Throws nothing. literally nothing. the drama is zero. πŸ’€

πŸ”₯ Complexity πŸ”₯

  1. Same as std::linear_congruential_engine(value).
  2. Same as std::linear_congruential_engine(seq).

signed off by cppreference.com πŸ’– version/date 2024.06.10 ✨ for the std::linear...engine::seed(3) page. mwah πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from