49 #ifndef __BASE_RANDOM_HH__
50 #define __BASE_RANDOM_HH__
54 #include <type_traits>
75 void init(uint32_t
s);
82 typename std::enable_if<std::is_integral<T>::value, T>
::type
86 std::uniform_int_distribution<T>
dist;
91 typename std::enable_if<std::is_floating_point<T>::value, T>
::type
95 std::uniform_real_distribution<T>
dist;
100 typename std::enable_if<std::is_integral<T>::value, T>
::type
103 std::uniform_int_distribution<T>
dist(min, max);
113 #endif // __BASE_RANDOM_HH__
std::enable_if< std::is_floating_point< T >::value, T >::type random()
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Basic support for object serialization.
void serialize(CheckpointOut &cp) const override
Serialize an object.
std::ostream CheckpointOut
const FlagsType dist
Print the distribution.
std::enable_if< std::is_integral< T >::value, T >::type random(T min, T max)