45 #ifndef __BASE_RANDOM_HH__ 46 #define __BASE_RANDOM_HH__ 50 #include <type_traits> 71 void init(uint32_t
s);
78 typename std::enable_if<std::is_integral<T>::value, T>
::type 82 std::uniform_int_distribution<T>
dist;
87 typename std::enable_if<std::is_floating_point<T>::value, T>
::type 91 std::uniform_real_distribution<T>
dist;
96 typename std::enable_if<std::is_integral<T>::value, T>
::type 99 std::uniform_int_distribution<T>
dist(min, max);
109 #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)