std::piecew...:operator()(3)

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

πŸ’… std::piecewise_constant_distribution::operator() πŸ’…

okay so bestie, this is the page for std::piecewise_constant_distribution::operator() from the C++ Standard Libary manual β€” section 3, and the header is out here abbreviating it as std::piecew...:operator()(3). It's giving very niche C++ but we're gonna get through it together, no cap. 🫢

πŸ’– NAME πŸ’–

std::piecewise_constant_distribution::operator() β€” and yep, the NAME section also lists std::piecewise_constant_distribution::operator() again. Same full name twice, and honestly? iconic. ✨

✨ Synopsis ✨

          template< class Generator >                                       (1)
       (since C++11)
          result_type operator()( Generator& g );
          template< class Generator >                                       (2)
       (since C++11)
          result_type operator()( Generator& g, const param_type& params );

This generates random numbers that are distributed according to the associated probability function. The entropy is acquired by calling g.operator(). πŸ’«

The first version uses the associated parameter set, and the second version uses params. The associated parameter set is not modified β€” hands off, bestie. πŸ™…β€β™€οΈ

πŸŽ€ Parameters πŸŽ€

  • g β€” a uniform random bit generator object.
  • params β€” distribution parameter set to use instead of the associated one.

πŸ¦‹ Type requirements πŸ¦‹

  • Generator must meet the requirements of UniformRandomBitGenerator.

🌸 Return value 🌸

  • The generated random number.

πŸ’« Complexity πŸ’«

  • Amortized constant number of invocations of g.operator().

xoxo, your C++ bestie πŸ’– source/version is http://cppreference.com, date is 2024.06.10, and the footer title is std::piecew...:operator()(3). bye bestie, go generate some random numbers responsibly βœ¨πŸ‘‘

πŸ“¦ where this page comes from