__gnu_cxx::subtractive_rng(3cxx)

πŸ’… NAME

__gnu_cxx::subtractive_rng β€” okay so this is a whole random-number-generator class living in the __gnu_cxx namespace, and it's been sitting in the 3cxx section of the manual this whole time, waiting for you to notice it. Bestie, we're noticing it now. 🫢


✨ SYNOPSIS ✨

#include <functional>

Inherits std::unary_function< unsigned int, unsigned int >. Yes, that std::unary_function. She's an heiress, she's got inheritance, it's giving old money. πŸ‘‘


πŸŽ€ Public Types

  • typedef unsigned int argument_type β€” literally just the type of the argument. That's the whole vibe.
  • typedef unsigned int result_type β€” and this one's the return type. She gives back what she takes, size-wise.

πŸ¦‹ Public Member Functions

  • subtractive_rng () β€” the default ctor ✨ it initializes its state with some number you don't see. Not me being mysterious, that's genuinely what the docs say. It's a secret. iykyk.
  • subtractive_rng (unsigned int __seed) β€” the ctor that lets you initialize the seed yourself, so you get to be the main character of the entropy. 🌈
  • void _M_initialize (unsigned int __seed) β€” internal init helper, does its thing with a seed. Move along, nothing to see, but we're listing it because we keep every detail in this house. πŸ’…
  • unsigned int operator() (unsigned int __limit) β€” call it like a function, hand it a limit, get back a number less than the argument. Periodt. πŸ“

🌸 Detailed Description

The subtractive_rng class is documented on SGI's site β€” so like, if you want the deep lore, that's where she lives. Meanwhile, right here, one thing matters a whole lot:

⚠️ this code assumes that int is 32 bits. no cap. if your int isn't 32 bits, this is not the fairy tale you were promised. 🧚

πŸ’– Member Typedef Documentation

typedef unsigned int std::unary_function< unsigned int , unsigned int >::argument_type [inherited]

argument_type is the type of the argument. inherited, so it's not even hers originally β€” she's just wearing her mama's typedef and it slays. ✨

typedef unsigned int std::unary_function< unsigned int , unsigned int >::result_type [inherited]

result_type is the return type. also inherited. also serving. πŸ’…


🧚 Constructor & Destructor Documentation

__gnu_cxx::subtractive_rng::subtractive_rng (unsigned int __seed) [inline]

Ctor allowing you to initialize the seed. you're in control, you pick the number, you're the main character. πŸ”₯

__gnu_cxx::subtractive_rng::subtractive_rng () [inline]

Default ctor; initializes its state with some number you don't see. she keeps her secrets, and honestly? respect. πŸ™ˆ


πŸ‘‘ Member Function Documentation

unsigned int __gnu_cxx::subtractive_rng::operator() (unsigned int __limit) [inline]

Returns a number less than the argument. that's it, that's the function, and honestly it ate. πŸŽ€


⭐ Author

Generated automatically by Doxygen for libstdc++ from the source code. not a human, not a vibe curator, just Doxygen doing Doxygen things. πŸ’€


and that's the whole page, bestie πŸ’– this little cutie came to you straight from libstdc++, filed under the 3cxx section β€” go forth and seed responsibly, mwah πŸ¦‹πŸŒΈ