std::bernou...distribution(3)
π std::bernou...distribution(3) β constructor era π
okay so bestie, welcome to the std::bernou...distribution(3) page from the C++ Standard Libary manual. yes, that spelling is staying exactly as it appears, we do not edit the source material π
πΈ NAME πΈ
std::bernoulli_distribution::bernoulli_distribution β literally the constructor for std::bernoulli_distribution, aka the thing that constructs the distribution object. icon behavior, no cap.
β¨ Synopsis β¨
three overloads, all since C++11, all here to construct a new distribution object. the exact shape is:
bernoulli_distribution() : bernoulli_distribution(0.5) { } (1)
(since C++11)
explicit bernoulli_distribution( double p ); (2)
(since C++11)
explicit bernoulli_distribution( const param_type& params ); (3)
(since C++11)
so what's the tea:
- overload
1is the default one, and its code delegates tobernoulli_distribution(0.5)β cute. - overload
2usespas the distribution parameter. - overload
3usesparamsas the distribution parameter.
all of them construct a new distribution object. periodt π«Ά
π Parameters π
pβ thepdistribution parameter (probability of generatingtrue). yes bestie, it's giving probability realness πparamsβ the distribution parameter set.
π Defect reports π
okay so these behavior-changing defect reports were applied retroactively to previously published C++ standards. not me learning lore from the archives π
P0935R0β applied to C++11 β behavior as published: the default constructor wasexplicit; correct behavior: madeimplicit.
that's the whole page, bestie π source: http://cppreference.com Β· date: 2024.06.10 Β· C++ Standard Libary manual, signing off with main character energy ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms