std::geomet...distribution(3)

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

okay so bestie, welcome to std::geomet...distribution(3) from the C++ Standard Libary manual β€” yes, β€œLibary” is literally how it’s spelled in the header, iykyk πŸ˜­πŸ’…. This page is all about the constructors for std::geometric_distribution, and it’s giving β€œshort but spicy”. Let’s get into it. ✨


🌸 NAME 🌸

  • std::geometric_distribution::geometric_distribution - std::geometric_distribution::geometric_distribution

πŸ“œ Synopsis πŸ“œ

   geometric_distribution() : geometric_distribution(0.5) {}    (1)
(since C++11)
   explicit geometric_distribution( double p );                 (2)
(since C++11)
   explicit geometric_distribution( const param_type& params ); (3)
(since C++11)

So what does it do? It constructs a new distribution object. πŸ’–

  1. Uses p as the distribution parameter.
  2. Uses params as the distribution parameter.
lowkey the default one (1) delegates to geometric_distribution(0.5) β€” that’s literally in the synopsis above, bestie. πŸ‘‘

πŸŽ€ Parameters πŸŽ€

  • p β€” the p distribution parameter (probability of a trial generating true)
  • params β€” the distribution parameter set

🧚 Notes 🧚

⚠️ Requires that 0 < p < 1. periodt. No sneaky out-of-range values, okay? 🫢

πŸ’€ 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

mwah πŸ’‹ this page came from http://cppreference.com, dated 2024.06.10, and the footer literally reads std::geomet...distribution(3). slay, you made it to the end. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from