std::discr...param_type(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 4 versions
, in arch rolling, fedora 44

πŸŽ€ 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 out discrete_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, __wbegin up 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 an initializer_list< double > called __wil.
  • template<typename _Func> param_type(size_t __nw, double __xmin, double __xmax, _Func __fw) β€” build one with __nw weights, where each weight k comes from calling __fw(__xmin + k * (__xmax - __xmin) / __nw) β€” that's a _Func doing 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 a std::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, __p1 and __p2, returns bool.

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