std::linear...ne::discard(3)
π NAME
okay so welcome to std::linear_congruential_engine::discard(3), straight outta the C++ Standard Libary manual (yes, that's their spelling, not mine π).
- Name:
std::linear_congruential_engine::discardβ and yep, the name line is literallystd::linear_congruential_engine::discardagain. iconic repetitive behavior, honestly.
πΈ Synopsis
void discard( unsigned long long z ); (since C++11)
This one advances the internal state by z times. It's exactly equivalent to calling operator() z times and then just discarding the result. no cap, that's the whole vibe: fast-forward energy, but for the engine's internal state β¨
π Parameters
zβ an integer value specifying the number of times to advance the state by. that's it, that's the parameter π«Ά
π Return value
- (none) β no return value, bestie. not even a little one. π
π₯ Complexity
No worse than the complexity of z consecutive calls to operator(). so like, it's not out here doing extra mysterious work behind your back π
π¦ Notes
For some engines, "fast jump" algorithms are known, which advance the state by many steps (order of millions) without calculating intermediate state transitions, although not necessarily in constant time. okay so that's the lil caveat: fast jump exists for some engines, but "fast" does not automatically mean "constant time," iykyk π
π See also
operator()β advances the engine's state and returns the generated value (C++11) (public member function). the main character function, fr fr π₯
mwah π sign-off time: this page is sourced from http://cppreference.com, version/date 2024.06.10, and the footer says std::linear...ne::discard(3). periodt π
π¦ 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