Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (21 sloc) 530 Bytes
#ifndef GETRAND_HPP_
# define GETRAND_HPP_
# include <random>
template<typename T>
class GetRand
{
private:
std::mt19937 _randomizer;
std::uniform_int_distribution<T> _uniform_tab;
public:
GetRand() = default;
GetRand(T min, T max, long seed) :
_randomizer{std::mt19937(seed)},
_uniform_tab{std::uniform_int_distribution<T>(min, max)}
{};
T operator()()
{
return (_uniform_tab(_randomizer));
}
};
#endif /* !GETRAND_HPP_ */
You can’t perform that action at this time.