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

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

πŸ’… NAME

std::subtract_with_carry_engine::discard β€” okay so this is the discard member of std::subtract_with_carry_engine, and the page is literally titled std::subtract_with_carry_engine::discard twice because man pages are dramatic like that πŸ’… this one comes straight from the C++ Standard Libary (their spelling, not mine πŸ˜…).


✨ Synopsis ✨

void discard( unsigned long long z );  (since C++11)

Advances the internal state by z times. Equivalent to calling operator() z times and discarding the result. No cap, that's the whole vibe: skip ahead by z, throw away what you skipped over 🫢


πŸŽ€ Parameters πŸŽ€

  • z β€” integer value specifying the number of times to advance the state by.

πŸ’– Return value πŸ’–

(none) β€” literally nothing comes back, bestie. It just quietly moves the state along πŸ™ˆ


πŸ”₯ Complexity πŸ”₯

No worse than the complexity of z consecutive calls to operator().


πŸ¦‹ Notes πŸ¦‹

For some engines, <rainbow>"fast jump"</rainbow> algorithms are known, which advance the state by many steps (order of millions) without calculating intermediate state transitions, although not necessarily in constant time. So yeah β€” big leap energy, but don't assume it's always constant-time, iykyk πŸ‘‘


🌈 See also 🌈

  • operator() β€” advances the engine's state and returns the generated value (C++11) (public member function).

shoutout to http://cppreference.com, version 2024.06.10, and the footer that says std::subtra...ne::discard(3) β€” bye bestie, go discard something responsibly πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from