|
bool | operator!= (const GeneratorWrapper< ResultType, Generator, Traits > &, const GeneratorWrapper< ResultType, Generator, Traits > &) |
|
template<typename CharT , typename CharTraits > |
std::basic_ostream< CharT, CharTraits > & | operator<< (std::basic_ostream< CharT, CharTraits > &os, const GeneratorWrapper< ResultType, Generator, Traits > &) |
|
bool | operator== (const GeneratorWrapper< ResultType, Generator, Traits > &, const GeneratorWrapper< ResultType, Generator, Traits > &) |
|
template<typename CharT , typename CharTraits > |
std::basic_istream< CharT, CharTraits > & | operator>> (std::basic_istream< CharT, CharTraits > &is, GeneratorWrapper< ResultType, Generator, Traits > &) |
|
template<typename ResultType, class Generator, typename Traits = traits::GeneratorWrapperMinMaxTrait<ResultType, Generator>>
class vsmc::GeneratorWrapper< ResultType, Generator, Traits >
A thin wrapper over any RNG Generator for use with C++11 API.
Generator need to have a member function named generate
which returns uniform integers on the range of ResultType
, which has to be one of uint16_t
, uint32_t
and uint64_t
. Note that, the generator does not necessarily returns one of these types. For example, on some platforms, some RNG returns unsigned long long
, which is 64-bits, while uint64_t
is also 64-bits but a typedef of unsigned long
. It is ok as long as the static_cast
from the returned value to uint64_t
does not change, add, or lose any bits.
For most RNG generators, use only need to write a thin wrapper to use this class. Also note that the operator==
will always return false as this wrapper assume that the internal states of the RNG cannot be determined by this library (otherwise will have to require more interfaces of Generator). And all member functions, except operator()
, does nothing. To seed and change the engine, use the Generator type object.
Definition at line 87 of file generator_wrapper.hpp.