4.6.0
Freundlich's C++ toolkit
|
A wrapper around pseudo random number generators.
Wraps a pseudo random number generator. This class is not copyable, although pseudo random number generators are. However, copying them is discouraged. Also, this class uses a strong typedef for the seed and doesn't allow any default value for it.
Generator | Must be a pseudo random number generator |
Public Types | |
using | result_type = typename wrapped::result_type |
The result type used for drawing random numbers. | |
using | seed = fcppt::strong_typedef< result_type ,_> |
Public Member Functions | |
basic_pseudo (seed _seed) | |
Constructs the generator using a seed. | |
template<typename SeedSeq > | |
basic_pseudo (SeedSeq &_seq) | |
Constructs the generator using a seed sequence. | |
~basic_pseudo () | |
Destroys the generator. | |
result_type | operator() () |
Draws a random number. | |
Static Public Member Functions | |
static constexpr result_type | min () |
Returns the minimum element of all the possible random numbers. | |
static constexpr result_type | max () |
Returns the maximum element of all the possible random numbers. | |
using fcppt::random::generator::basic_pseudo< Generator >::result_type = typename wrapped::result_type |
The result type used for drawing random numbers.
using fcppt::random::generator::basic_pseudo< Generator >::seed = fcppt::strong_typedef< result_type ,_> |
|
explicit |
Constructs the generator using a seed.
Constructs the generator using _seed
_seed | The seed to use |
|
explicit |
Constructs the generator using a seed sequence.
Constructs the generator using _seq
SeedSeq | must be a seed sequence |
fcppt::random::generator::basic_pseudo< Generator >::~basic_pseudo | ( | ) |
Destroys the generator.
|
staticconstexpr |
Returns the maximum element of all the possible random numbers.
|
staticconstexpr |
Returns the minimum element of all the possible random numbers.
result_type fcppt::random::generator::basic_pseudo< Generator >::operator() | ( | ) |
Draws a random number.