std::unifor...distribution(3)

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

πŸ’– std::uniform_int_distribution::uniform_int_distribution πŸ’–

okay bestie, welcome to the C++ Standard Libary manual page for std::uniform_int_distribution::uniform_int_distribution β€” you may also spot the tag std::unifor...distribution(3) chilling at the top, because the terminal had to truncate it 😭. we're gonna keep every detail and still make it cute. periodt.


🌸 NAME 🌸

  • std::uniform_int_distribution::uniform_int_distribution β€” std::uniform_int_distribution::uniform_int_distribution (yes, it's the same mouthful twice, and it's iconic πŸ’…)

πŸ¦‹ Synopsis πŸ¦‹

uniform_int_distribution() : uniform_int_distribution(0) { }
explicit uniform_int_distribution( IntType a,
                                   IntType b =
                                   std::numeric_limits<IntType>::max() );
explicit uniform_int_distribution( const param_type& params );
  • (1) (since C++11) β€” the no-argument constructor.
  • (2) (since C++11) β€” the a/b constructor, where b defaults to std::numeric_limits<IntType>::max().
  • (3) (since C++11) β€” the params constructor.

this constructor constructs new distribution object ✨

  • (2) uses a and b as the distribution parameters.
  • (3) uses params as the distribution parameters.
⚠️ the behavior is undefined if a > b ⚠️ β€” fr fr, not a cute look, do not pass a bigger minimum than maximum πŸ’€

πŸŽ€ Parameters πŸŽ€

  • a β€” the a distribution parameter (minimum value)
  • b β€” the b distribution parameter (maximum value)
  • params β€” the distribution parameter set

πŸ‘‘ Defect reports πŸ‘‘

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • DR: P0935R0 β€” Applied to: C++11; Behavior as published: default constructor was explicit; Correct behavior: made implicit.

okay bye bestie 🫢 source is http://cppreference.com, version/date is 2024.06.10, and the manual tag is std::unifor...distribution(3) β€” slay and read safely πŸ’…βœ¨

πŸ“¦ where this page comes from