STD::DISCARD_BLOCK_ENGINE(3)
π std::discard_block_engine< _RandomNumberEngine, __p, __r > π
okay so bestie, this whole thing is straight out of the libstdc++ Library Functions Manual (yep, the library functions section, (3) energy π«Ά), and I'm about to translate it into feelings. no facts lost, no cap. let's go β¨
πΈ NAME πΈ
std::discard_block_engine< _RandomNumberEngine, __p, __r >
that's it. that's the name. iconic, honestly. π
π SYNOPSIS π
#include <random>
π¦ Public Types
template<typename _Sseq> using _If_seed_seqtypedef _RandomNumberEngine::result_type result_type
β¨ Public Member Functions
discard_block_engine ()β Constructs a defaultdiscard_block_engineengine.discard_block_engine (_RandomNumberEngine &&__rng)β Move constructs adiscard_block_engineengine.template<typename _Sseq, typename = _If_seed_seq<_Sseq>> discard_block_engine (_Sseq &__q)β Generator construct adiscard_block_engineengine.discard_block_engine (const _RandomNumberEngine &__rng)β Copy constructs adiscard_block_engineengine.discard_block_engine (result_type __s)β Seed constructs adiscard_block_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 thediscard_block_engineobject with the default seed for the underlying base class generator engine.template<typename _Sseq> _If_seed_seq< _Sseq > seed (_Sseq &__q)β Reseeds thediscard_block_engineobject with the given seed sequence.void seed (result_type __s)β Reseeds thediscard_block_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.
π Static Public Attributes
static constexpr size_t block_sizestatic constexpr size_t used_block
π Friends
template<typename _RandomNumberEngine1, size_t __p1, size_t __r1, typename _CharT, typename _Traits> std::basic_ostream< _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &__os, const std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)β Inserts the current state of adiscard_block_enginerandom number generator engine__xinto the output stream__os.bool operator== (const discard_block_engine &__lhs, const discard_block_engine &__rhs)β Compares twodiscard_block_enginerandom number generator objects of the same type for equality.template<typename _RandomNumberEngine1, size_t __p1, size_t __r1, typename _CharT, typename _Traits> std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)β Extracts the current state of a% subtract_with_carry_enginerandom number generator engine__xfrom the input stream__is.
π DESCRIPTION π
π« Detailed Description
template<typename _RandomNumberEngine, size_t __p, size_t __r>
class std::discard_block_engine< _RandomNumberEngine, __p, __r >
"Produces random numbers from some base engine by discarding blocks of data. π
Precondition
$ 0 r p $.RE
Since
C++11 β¨
so yeah, it takes a base engine, makes numbers, and then just... throws away whole blocks of them. it's giving "I said what I said" energy and honestly? respect. π
π§ Member Typedef Documentation π§
template<typename _RandomNumberEngine, size_t __p, size_t __r>
typedef _RandomNumberEngine::result_type std::discard_block_engine< _RandomNumberEngine, __p, __r >::result_type
The type of the generated random value. π
π Constructor & Destructor Documentation π
template<typename _RandomNumberEngine, size_t __p, size_t __r>
std::discard_block_engine< _RandomNumberEngine, __p, __r >::discard_block_engine () [inline]
Constructs a default discard_block_engine engine. The underlying engine is default constructed as well. lowkey the "just roll with it" constructor. β¨
template<typename _RandomNumberEngine, size_t __p, size_t __r>
std::discard_block_engine< _RandomNumberEngine, __p, __r >::discard_block_engine (const _RandomNumberEngine & __rng) [inline], [explicit]
Copy constructs a discard_block_engine engine. Copies an existing base class random number generator.
Parameters
__rngβ An existing (base class) engine object.
template<typename _RandomNumberEngine, size_t __p, size_t __r>
std::discard_block_engine< _RandomNumberEngine, __p, __r >::discard_block_engine (_RandomNumberEngine && __rng) [inline], [explicit]
Move constructs a discard_block_engine engine. Copies an existing base class random number generator. (yes bestie, it says "Copies" β I'm not editing the source, I'm just the messenger π)
Parameters
__rngβ An existing (base class) engine object.
template<typename _RandomNumberEngine, size_t __p, size_t __r>
std::discard_block_engine< _RandomNumberEngine, __p, __r >::discard_block_engine (result_type __s) [inline], [explicit]
Seed constructs a discard_block_engine engine. Constructs the underlying generator engine seeded with __s. π±
Parameters
__sβ A seed value for the base class engine.
template<typename _RandomNumberEngine, size_t __p, size_t __r>
template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
std::discard_block_engine< _RandomNumberEngine, __p, __r >::discard_block_engine (_Sseq & __q) [inline], [explicit]
Generator construct a discard_block_engine engine. (yes, "Generator construct", we love a typo that ate π
)
Parameters
__qβ A seed sequence.
π Member Function Documentation π
template<typename _RandomNumberEngine, size_t __p, size_t __r>
const _RandomNumberEngine & std::discard_block_engine< _RandomNumberEngine, __p, __r >::base () const [inline], [noexcept]
Gets a const reference to the underlying generator engine object. peek behind the curtain, but make it const. π«Ά
template<typename _RandomNumberEngine, size_t __p, size_t __r>
void std::discard_block_engine< _RandomNumberEngine, __p, __r >::discard (unsigned long long __z) [inline]
Discard a sequence of random numbers. bye girl, not needed π
template<typename _RandomNumberEngine, size_t __p, size_t __r>
constexpr result_type std::discard_block_engine< _RandomNumberEngine, __p, __r >::max () [inline], [static], [constexpr]
Gets the maximum value in the generated random number range. π₯
template<typename _RandomNumberEngine, size_t __p, size_t __r>
constexpr result_type std::discard_block_engine< _RandomNumberEngine, __p, __r >::min () [inline], [static], [constexpr]
Gets the minimum value in the generated random number range. πΈ
template<typename _RandomNumberEngine, size_t __p, size_t __r>
discard_block_engine< _RandomNumberEngine, __p, __r >::result_type
std::discard_block_engine< _RandomNumberEngine, __p, __r >::operator() ()
Gets the next value in the generated random number sequence. the main character function, fr fr. β
template<typename _RandomNumberEngine, size_t __p, size_t __r>
void std::discard_block_engine< _RandomNumberEngine, __p, __r >::seed () [inline]
Reseeds the discard_block_engine object with the default seed for the underlying base class generator engine. fresh start energy. π¦
template<typename _RandomNumberEngine, size_t __p, size_t __r>
template<typename _Sseq>
_If_seed_seq< _Sseq >
std::discard_block_engine< _RandomNumberEngine, __p, __r >::seed (_Sseq & __q) [inline]
Reseeds the discard_block_engine object with the given seed sequence.
Parameters
__qβ A seed generator function.
template<typename _RandomNumberEngine, size_t __p, size_t __r>
void std::discard_block_engine< _RandomNumberEngine, __p, __r >::seed (result_type __s) [inline]
Reseeds the discard_block_engine object with the default seed for the underlying base class generator engine. (yep, same sentence as the no-arg seed(), that's just how it is bestie π)
π Friends And Related Symbol Documentation π
template<typename _RandomNumberEngine, size_t __p, size_t __r>
template<typename _RandomNumberEngine1, size_t __p1, size_t __r1, typename _CharT, typename _Traits>
std::basic_ostream< _CharT, _Traits > &
operator<< (std::basic_ostream< _CharT, _Traits > & __os, const std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > & __x) [friend]
Inserts the current state of a discard_block_engine random number generator engine __x into the output stream __os. spill the state, bestie. π
Parameters
__osβ An output stream.__xβ Adiscard_block_enginerandom number generator engine.
Returns
The output stream with the state of __x inserted or in an error state.
template<typename _RandomNumberEngine, size_t __p, size_t __r>
bool
operator== (const discard_block_engine< _RandomNumberEngine, __p, __r > & __lhs, const discard_block_engine< _RandomNumberEngine, __p, __r > & __rhs) [friend]
Compares two discard_block_engine random number generator objects of the same type for equality. are they the same girl? vibe check. β¨
Parameters
__lhsβ Adiscard_block_enginerandom number generator object.__rhsβ Anotherdiscard_block_enginerandom number generator object.
Returns
true if the infinite sequences of generated values would be equal, false otherwise.
template<typename _RandomNumberEngine, size_t __p, size_t __r>
template<typename _RandomNumberEngine1, size_t __p1, size_t __r1, typename _CharT, typename _Traits>
std::basic_istream< _CharT, _Traits > &
operator>> (std::basic_istream< _CharT, _Traits > & __is, std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > & __x) [friend]
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from the input stream __is. (yes it says subtract_with_carry_engine in a discard_block_engine doc β I don't make the rules, I just report them ππ)
Parameters
__isβ An input stream.__xβ Adiscard_block_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.
okay bestie that's the whole page, every flag, every parameter, every friend, every [inline] and [explicit] and [noexcept] accounted for. periodt. π
this little beauty came to you courtesy of the libstdc++ manual (section (3), Library Functions Manual), and it was generated automatically by Doxygen for libstdc++ straight from the source code β no date on it, just vibes and a (3). slay, stay hydrated, and may your engines always reseed cleanly πβ¨π¦π
π¦ 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