STD::INDEPENDENT_BITS_ENGINE(3)
πΈ NAME πΈ
std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >
ok so this whole entire page lives in the Library Functions Manual, and the main character is std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >. Yes, every angle bracket, every underscore, all of it, we are not abbreviating bestie, that's the name, periodt π
β¨ SYNOPSIS β¨
#include <random>
π Public Types π
typedef _UIntType result_type
π¦ Public Member Functions π¦
independent_bits_engine ()β Constructs a defaultindependent_bits_engineengine.independent_bits_engine (_RandomNumberEngine &&__rng)β Move constructs aindependent_bits_engineengine.template<typename _Sseq, typename = _If_seed_seq<_Sseq>> independent_bits_engine (_Sseq &__q)β Generator construct aindependent_bits_engineengine.independent_bits_engine (const _RandomNumberEngine &__rng)β Copy constructs aindependent_bits_engineengine.independent_bits_engine (result_type __s)β Seed constructs aindependent_bits_engineengine.const _RandomNumberEngine & base () const noexceptβ Gets a const reference to the underlying generator engine object.void discard (unsigned long long __z)β Discard a sequence of random numbers.result_type operator() ()β Gets the next value in the generated random number sequence.void seed ()β Reseeds theindependent_bits_engineobject with the default seed for the underlying base class generator engine.template<typename _Sseq> _If_seed_seq< _Sseq > seed (_Sseq &__q)β Reseeds theindependent_bits_engineobject with the given seed sequence.void seed (result_type __s)β Reseeds theindependent_bits_engineobject with the default seed for the underlying base class generator engine.
β Static Public Member Functions β
static constexpr result_type max ()β Gets the maximum value in the generated random number range.static constexpr result_type min ()β Gets the minimum value in the generated random number range.
π«Ά Friends π«Ά
bool operator== (const independent_bits_engine &__lhs, const independent_bits_engine &__rhs)β Compares twoindependent_bits_enginerandom number generator objects of the same type for equality.template<typename _CharT, typename _Traits> std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__x)β Extracts the current state of a%subtract_with_carry_enginerandom number generator engine__xfrom the input stream__is.
π Detailed Description π
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
class std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >
"Produces random numbers by combining random numbers from some base engine to produce random numbers with a specified number of bits __w.
Since: C++11
ngl that's the whole vibe: it takes a base engine, mixes its output, and hands you numbers with exactly __w bits. iconic behaviour fr fr π
π§ Member Typedef Documentation π§
result_type
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
typedef _UIntType std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::result_type
The type of the generated random value. that's it, that's the typedef, she's simple and she's perfect β¨
π Constructor & Destructor Documentation π
independent_bits_engine () β default ctor
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::independent_bits_engine () [inline]
Constructs a default independent_bits_engine engine. The underlying engine is default constructed as well. π
Referenced by operator==.
independent_bits_engine (const _RandomNumberEngine & __rng) β copy ctor
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::independent_bits_engine (const _RandomNumberEngine & __rng) [inline], [explicit]
Copy constructs a independent_bits_engine engine. Copies an existing base class random number generator.
Parameters
__rngβ An existing (base class) engine object.
independent_bits_engine (_RandomNumberEngine && __rng) β move ctor
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::independent_bits_engine (_RandomNumberEngine && __rng) [inline], [explicit]
Move constructs a independent_bits_engine engine. Copies an existing base class random number generator.
Parameters
__rngβ An existing (base class) engine object.
References std::move().
independent_bits_engine (result_type __s) β seed ctor
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::independent_bits_engine (result_type __s) [inline], [explicit]
Seed constructs a independent_bits_engine engine. Constructs the underlying generator engine seeded with __s.
Parameters
__sβ A seed value for the base class engine.
independent_bits_engine (_Sseq & __q) β seed-sequence ctor
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::independent_bits_engine (_Sseq & __q) [inline], [explicit]
Generator construct a independent_bits_engine engine.
Parameters
__qβ A seed sequence.
π Member Function Documentation π
base ()
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
const _RandomNumberEngine & std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::base () const [inline], [noexcept]
Gets a const reference to the underlying generator engine object. peek at the engine underneath, respectfully π«Ά
discard (unsigned long long __z)
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
void std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::discard (unsigned long long __z) [inline]
Discard a sequence of random numbers. yeet __z of them straight into the void π
max ()
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
constexpr result_type std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::max () [inline], [static], [constexpr]
Gets the maximum value in the generated random number range.
min ()
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
constexpr result_type std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::min () [inline], [static], [constexpr]
Gets the minimum value in the generated random number range.
operator() ()
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::result_type std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::operator() ()
Gets the next value in the generated random number sequence. this is the one you actually call, bestie, the moment of truth π₯
References std::__lg(), std::__numeric_limits_base::digits, and std::numeric_limits< _Tp >::max().
seed ()
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
void std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::seed () [inline]
Reseeds the independent_bits_engine object with the default seed for the underlying base class generator engine.
seed (_Sseq & __q)
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
template<typename _Sseq> _If_seed_seq< _Sseq >
std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::seed (_Sseq & __q) [inline]
Reseeds the independent_bits_engine object with the given seed sequence.
Parameters
__qβ A seed generator function.
seed (result_type __s)
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
void std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType >::seed (result_type __s) [inline]
Reseeds the independent_bits_engine object with the default seed for the underlying base class generator engine.
π Friends And Related Symbol Documentation π
operator==
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
bool operator== (const independent_bits_engine< _RandomNumberEngine, __w, _UIntType > & __lhs, const independent_bits_engine< _RandomNumberEngine, __w, _UIntType > & __rhs) [friend]
Compares two independent_bits_engine random number generator objects of the same type for equality. same type only, don't be messy π
Parameters
__lhsβ Aindependent_bits_enginerandom number generator object.__rhsβ Anotherindependent_bits_enginerandom number generator object.
Returns
true if the infinite sequences of generated values would be equal, false otherwise.
References independent_bits_engine().
operator>>
template<typename _RandomNumberEngine, size_t __w, typename _UIntType>
template<typename _CharT, typename _Traits>
std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > & __is, std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > & __x) [friend]
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from the input stream __is.
Parameters
__isβ An input stream.__xβ Aindependent_bits_enginerandom number generator engine.
Returns
The input stream with the state of __x extracted or in an error state.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
and that's the whole page bestie, no cap, every single constructor, every flag-less flag, every __underscore accounted for π this was written for libstdc++, and yes the automatic Doxygen generation is the author, the source code is the blueprint, and std::indep..._UIntType >(3) is still lowkey the most iconic truncated page title in the whole Library Functions Manual. slay, go seed something πβ¨π
π¦ 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 43: libstdc++-docs 15.2.1-2.fc43 Β· 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 43: libstdc++-docs 15.3.1-1.fc43 Β· 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.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