std::discr...param_type(3)
π std::discr...param_type(3) π
okay bestie, so this is a page straight out of the Library Functions Manual, section 3, and it's all about std::discrete_distribution< _IntType >::param_type β the little parameter-type struct that lives inside your discrete distribution. it's niche, it's cute, it's giving template energy π
β¨ NAME β¨
std::discrete_distribution< _IntType >::param_type β the parameter type for std::discrete_distribution< _IntType >. no cap, that's literally the whole name.
πΈ SYNOPSIS πΈ
first thing first, you gotta pull it in:
#include <random>
π Public Types
one (1) type, and it's serving:
typedef discrete_distribution< _IntType > distribution_typeβ a lil alias so you don't have to keep typing outdiscrete_distribution< _IntType >like a menace.
π¦ Public Member Functions
here's the whole roster, bestie, all of it, not skipping a single one:
template<typename _InputIterator> param_type(_InputIterator __wbegin, _InputIterator __wend)β build one from a range of weights,__wbeginup to__wend.param_type(const param_type &) = defaultβ the copy constructor. it's defaulted, she's just like that.param_type(initializer_list< double > __wil)β build one straight from aninitializer_list< double >called__wil.template<typename _Func> param_type(size_t __nw, double __xmin, double __xmax, _Func __fw)β build one with__nwweights, where each weightkcomes from calling__fw(__xmin + k * (__xmax - __xmin) / __nw)β that's a_Funcdoing the work.param_type & operator=(const param_type &) = defaultβ assignment operator, also defaulted, also unbothered.std::vector< double > probabilities() constβ hands you back the probabilities as astd::vector< double >. iconic.
π«Ά Friends
yes she has friends, and we love that for her:
class discrete_distribution< _IntType >β the distribution herself is a friend.bool operator==(const param_type &__p1, const param_type &__p2)β compare two param types for equality. two args,__p1and__p2, returnsbool.
π Detailed Description π
template<typename _IntType = int>
struct std::discrete_distribution< _IntType >::param_type
and the description, verbatim vibe: "Parameter type." that's it. that's the whole description. short, sweet, main character energy π
β Author β
Generated automatically by Doxygen for libstdc++ from the source code. (not a human, just Doxygen doing its thing, and honestly? ate.)
so yeah, that's the whole page fr fr π this lil corner of the libstdc++ manual, section 3, brought to you by libstdc++ and its Doxygen-generated source code β no date on this one bestie, the footer keeps it mysterious πβ¨ bye ily, go read your <random> header π¦
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms