4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt::random::generator::basic_pseudo< Generator > Class Template Reference

Detailed Description

template<typename Generator>
class fcppt::random::generator::basic_pseudo< Generator >

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.

Template Parameters
GeneratorMust 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.
 

Member Typedef Documentation

◆ result_type

template<typename Generator >
using fcppt::random::generator::basic_pseudo< Generator >::result_type = typename wrapped::result_type

The result type used for drawing random numbers.

◆ seed

template<typename Generator >
using fcppt::random::generator::basic_pseudo< Generator >::seed = fcppt::strong_typedef< result_type ,_>

Constructor & Destructor Documentation

◆ basic_pseudo() [1/2]

template<typename Generator >
fcppt::random::generator::basic_pseudo< Generator >::basic_pseudo ( seed _seed)
explicit

Constructs the generator using a seed.

Constructs the generator using _seed

Parameters
_seedThe seed to use

◆ basic_pseudo() [2/2]

template<typename Generator >
template<typename SeedSeq >
fcppt::random::generator::basic_pseudo< Generator >::basic_pseudo ( SeedSeq & _seq)
explicit

Constructs the generator using a seed sequence.

Constructs the generator using _seq

Template Parameters
SeedSeqmust be a seed sequence

◆ ~basic_pseudo()

template<typename Generator >
fcppt::random::generator::basic_pseudo< Generator >::~basic_pseudo ( )

Destroys the generator.

Member Function Documentation

◆ max()

template<typename Generator >
static constexpr result_type fcppt::random::generator::basic_pseudo< Generator >::max ( )
staticconstexpr

Returns the maximum element of all the possible random numbers.

◆ min()

template<typename Generator >
static constexpr result_type fcppt::random::generator::basic_pseudo< Generator >::min ( )
staticconstexpr

Returns the minimum element of all the possible random numbers.

◆ operator()()

template<typename Generator >
result_type fcppt::random::generator::basic_pseudo< Generator >::operator() ( )

Draws a random number.