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 default independent_bits_engine engine.
  • independent_bits_engine (_RandomNumberEngine &&__rng) β€” Move constructs a independent_bits_engine engine.
  • template<typename _Sseq, typename = _If_seed_seq<_Sseq>> independent_bits_engine (_Sseq &__q) β€” Generator construct a independent_bits_engine engine.
  • independent_bits_engine (const _RandomNumberEngine &__rng) β€” Copy constructs a independent_bits_engine engine.
  • independent_bits_engine (result_type __s) β€” Seed constructs a independent_bits_engine engine.
  • 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 the independent_bits_engine object with the default seed for the underlying base class generator engine.
  • template<typename _Sseq> _If_seed_seq< _Sseq > seed (_Sseq &__q) β€” Reseeds the independent_bits_engine object with the given seed sequence.
  • void seed (result_type __s) β€” Reseeds the independent_bits_engine object 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 two independent_bits_engine random 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_engine random number generator engine __x from 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.


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 β€” A independent_bits_engine random number generator object.
  • __rhs β€” Another independent_bits_engine random 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 β€” A independent_bits_engine random 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