std::experi...berGenerator(3)

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

okay bestie, welcome to the std::experi...berGenerator(3) page from the C++ Standard Libary manual β€” yes, the header literally says β€œLibary,” and I’m not about to gaslight you by fixing it. 🫢

πŸŽ€ NAME πŸŽ€

std::experimental::ranges::UniformRandomNumberGenerator β€” and again for the people in the back: std::experimental::ranges::UniformRandomNumberGenerator. That’s the whole name section, repeated twice, and honestly? iconic. πŸ’…


🌸 Synopsis 🌸

Defined in header <experimental/ranges/random> ✨

          template< class G >

          concept bool UniformRandomNumberGenerator =
              Invocable<G&> &&
              UnsignedIntegral<std::result_of_t<G&()>> &&          (ranges TS)
              requires {
                  { G::min() } -> Same<std::result_of_t<G&()>>&&;
                  { G::max() } -> Same<std::result_of_t<G&()>>&&;

              };

okay so the concept UniformRandomNumberGenerator<G> specifies that G is the type of a uniform random number generator. That is: objects of type G are a function object returning unsigned integer values, such that each value in the range of possible results has (ideally) equal probability of being returned. equal probability is the whole vibe check here, no cap. πŸŽ²πŸ’–

UniformRandomNumberGenerator<G> is satisfied only if, given any object g of type G, all of these are true:

  • G::min() and G::max() are prvalue constant expressions;
  • G::min() < G::max()
  • g() is in the range [G::min(), G::max()]
  • g() has amortized constant complexity.

made with πŸ’– from source http://cppreference.com, version/date 2024.06.10, on the std::experi...berGenerator(3) page β€” mwah πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from