std::linear...ne::discard(3)

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

πŸ’… 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 literally std::linear_congruential_engine::discard again. 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