std::discard_block(3)
β¨ std::discard_block(3) β¨
okay bestie, welcome to this Library Functions Manual page π
the main character is std::discard_block, a C++ template class that produces random numbers from some base engine by discarding blocks of data. The original NAME section literally just says std::discard_block - with no extra blurb, so that's the vibe. periodt π
π NAME π
std::discard_block -
πΈ SYNOPSIS πΈ
π Public Types π
typedef _UniformRandomNumberGenerator base_typetypedef base_type::result_type result_type
π Public Member Functions π
const base_type & base () consttemplate<class _Gen > discard_block (_Gen &__g)discard_block (unsigned long __s)discard_block (const base_type &__rng)discard_block ()result_type max () constresult_type min () constresult_type operator() ()template<class _Gen > void seed (_Gen &__g)void seed ()
π¦ Static Public Attributes π¦
static const int block_sizestatic const int used_block
π₯ Friends π₯
bool operator!= (const discard_block &__lhs, const discard_block &__rhs)
template<class _UniformRandomNumberGenerator1 , int __p1, int __r1,
typename _CharT , typename _Traits > std::basic_ostream< _CharT,
_Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &__os,
const discard_block< _UniformRandomNumberGenerator1, __p1, __r1 >
&__x)
bool operator== (const discard_block &__lhs, const discard_block &__rhs)
template<class _UniformRandomNumberGenerator1 , int __p1, int __r1,
typename _CharT , typename _Traits > std::basic_istream< _CharT,
_Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is,
discard_block< _UniformRandomNumberGenerator1, __p1, __r1 > &__x)
π Detailed Description π
ngl, the template signature is long but she's worth it:
template<class _UniformRandomNumberGenerator, int __p, int __r> class
std::discard_block< _UniformRandomNumberGenerator, __p, __r >
She produces random numbers from some base engine by discarding blocks of data β that's the whole bit, no cap.
Constraint check, bestie: 0 <= __r <= __p.
Definition at line 1078 of file tr1_impl/random.
π§ Member Typedef Documentation π§
π base_type
template<class _UniformRandomNumberGenerator, int __p, int __r> typedef
_UniformRandomNumberGenerator std::discard_block<
_UniformRandomNumberGenerator, __p, __r >::base_type
The type of the underlying generator engine. iconic.
Definition at line 1085 of file tr1_impl/random.
πΈ result_type
template<class _UniformRandomNumberGenerator, int __p, int __r> typedef
base_type::result_type std::discard_block<
_UniformRandomNumberGenerator, __p, __r >::result_type
The type of the generated random value. slay.
Definition at line 1087 of file tr1_impl/random.
π Constructor & Destructor Documentation π
π discard_block ()
template<class _UniformRandomNumberGenerator, int __p, int __r>
std::discard_block< _UniformRandomNumberGenerator, __p, __r
>::discard_block () [inline]
Constructs a default discard_block engine.
The underlying engine is default constructed as well.
Definition at line 1098 of file tr1_impl/random.
π¦ discard_block (const base_type & __rng)
template<class _UniformRandomNumberGenerator, int __p, int __r>
std::discard_block< _UniformRandomNumberGenerator, __p, __r
>::discard_block (const base_type & __rng) [inline, explicit]
Copy constructs a discard_block engine.
Copies an existing base class random number generator.
Parameters:
rngβ An existing (base class) engine object.
Definition at line 1108 of file tr1_impl/random.
π₯ discard_block (unsigned long __s)
template<class _UniformRandomNumberGenerator, int __p, int __r>
std::discard_block< _UniformRandomNumberGenerator, __p, __r
>::discard_block (unsigned long __s) [inline, explicit]
Seed constructs a discard_block engine.
Constructs the underlying generator engine seeded with __s.
Parameters:
__sβ A seed value for the base class engine.
Definition at line 1118 of file tr1_impl/random.
π discard_block (_Gen & __g)
template<class _UniformRandomNumberGenerator, int __p, int __r>
template<class _Gen > std::discard_block< _UniformRandomNumberGenerator,
__p, __r >::discard_block (_Gen & __g) [inline]
Generator construct a discard_block engine.
Parameters:
__gβ A seed generator function.
Definition at line 1127 of file tr1_impl/random.
π Member Function Documentation π
πΈ base ()
template<class _UniformRandomNumberGenerator, int __p, int __r> const
base_type& std::discard_block< _UniformRandomNumberGenerator, __p, __r
>::base () const [inline]
Gets a const reference to the underlying generator engine object.
Definition at line 1156 of file tr1_impl/random.
π max ()
template<class _UniformRandomNumberGenerator, int __p, int __r> result_type
std::discard_block< _UniformRandomNumberGenerator, __p, __r >::max ()
const [inline]
Gets the maximum value in the generated random number range.
Definition at line 1170 of file tr1_impl/random.
π min ()
template<class _UniformRandomNumberGenerator, int __p, int __r> result_type
std::discard_block< _UniformRandomNumberGenerator, __p, __r >::min ()
const [inline]
Gets the minimum value in the generated random number range.
Definition at line 1163 of file tr1_impl/random.
π₯ operator() ()
template<class _UniformRandomNumberGenerator , int __p, int __r>
discard_block< _UniformRandomNumberGenerator, __p, __r >::result_type
std::discard_block< _UniformRandomNumberGenerator, __p, __r
>::operator() () [inline]
Gets the next value in the generated random number sequence.
Definition at line 583 of file random.tcc.
π¦ seed (_Gen & __g)
template<class _UniformRandomNumberGenerator, int __p, int __r>
template<class _Gen > void std::discard_block<
_UniformRandomNumberGenerator, __p, __r >::seed (_Gen & __g) [inline]
Reseeds the discard_block object with the given seed generator function.
Parameters:
__gβ A seed generator function.
Definition at line 1146 of file tr1_impl/random.
π seed ()
template<class _UniformRandomNumberGenerator, int __p, int __r> void
std::discard_block< _UniformRandomNumberGenerator, __p, __r >::seed ()
[inline]
Reseeds the discard_block object with the default seed for the underlying base class generator engine.
Definition at line 1134 of file tr1_impl/random.
π«Ά Friends And Related Function Documentation π«Ά
β operator!=
template<class _UniformRandomNumberGenerator, int __p, int __r> bool
operator!= (const discard_block< _UniformRandomNumberGenerator, __p, __r
> & __lhs, const discard_block< _UniformRandomNumberGenerator, __p, __r
> & __rhs) [friend]
Compares two discard_block random number generator objects of the same type for inequality.
Parameters:
__lhsβ Adiscard_blockrandom number generator object.__rhsβ Anotherdiscard_blockrandom number generator object.
Returns: true if the two objects are not equal, false otherwise.
Definition at line 1204 of file tr1_impl/random.
π operator<<
template<class _UniformRandomNumberGenerator, int __p, int __r>
template<class _UniformRandomNumberGenerator1 , int __p1, int __r1,
typename _CharT , typename _Traits > std::basic_ostream<_CharT,
_Traits>& operator<< (std::basic_ostream< _CharT, _Traits > &__os,
const discard_block< _UniformRandomNumberGenerator1, __p1, __r1 > &__x)
[friend]
Inserts the current state of a discard_block random number generator engine __x into the output stream __os.
Parameters:
__osβ An output stream.__xβ Adiscard_blockrandom number generator engine.
Returns: The output stream with the state of __x inserted or in an error state.
π operator==
template<class _UniformRandomNumberGenerator, int __p, int __r> bool
operator== (const discard_block< _UniformRandomNumberGenerator, __p, __r
> & __lhs, const discard_block< _UniformRandomNumberGenerator, __p, __r
> & __rhs) [friend]
Compares two discard_block random number generator objects of the same type for equality.
Parameters:
__lhsβ Adiscard_blockrandom number generator object.__rhsβ Anotherdiscard_blockrandom number generator object.
Returns: true if the two objects are equal, false otherwise.
Definition at line 1190 of file tr1_impl/random.
π operator>>
template<class _UniformRandomNumberGenerator, int __p, int __r>
template<class _UniformRandomNumberGenerator1 , int __p1, int __r1,
typename _CharT , typename _Traits > std::basic_istream<_CharT,
_Traits>& operator>> (std::basic_istream< _CharT, _Traits > &__is,
discard_block< _UniformRandomNumberGenerator1, __p1, __r1 > &__x)
[friend]
Extracts the current state of a % subtract_with_carry random number generator engine __x from the input stream __is. yes, the original says % subtract_with_carry right there β I'm keeping it exactly, bestie.
Parameters:
__isβ An input stream.__xβ Adiscard_blockrandom 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.
bye bestie π«Ά this page is from libstdc++, dated 21 Apr 2009 β the original footer also had std::discard_block(3) hanging out on the right, and now you know the whole lore. π
π¦ where this page comes from
- nixpkgs unstable: std-man-pages 4.4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms