std::linear...engine::seed(3)
π 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. π²
- Right after the state is set,
*this == std::linear_congruential_engine(value)is true. β - 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 π₯
- Same as
std::linear_congruential_engine(value). - 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
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms