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_seq
  • typedef _RandomNumberEngine::result_type result_type

✨ Public Member Functions

  • discard_block_engine () β€” Constructs a default discard_block_engine engine.
  • discard_block_engine (_RandomNumberEngine &&__rng) β€” Move constructs a discard_block_engine engine.
  • template<typename _Sseq, typename = _If_seed_seq<_Sseq>> discard_block_engine (_Sseq &__q) β€” Generator construct a discard_block_engine engine.
  • discard_block_engine (const _RandomNumberEngine &__rng) β€” Copy constructs a discard_block_engine engine.
  • discard_block_engine (result_type __s) β€” Seed constructs a discard_block_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 discard_block_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 discard_block_engine object with the given seed sequence.
  • void seed (result_type __s) β€” Reseeds the discard_block_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.

🌈 Static Public Attributes

  • static constexpr size_t block_size
  • static 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 a discard_block_engine random number generator engine __x into the output stream __os.
  • bool operator== (const discard_block_engine &__lhs, const discard_block_engine &__rhs) β€” Compares two discard_block_engine random 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_engine random number generator engine __x from 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 😭)


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


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