aboutsummaryrefslogtreecommitdiff
path: root/src/random.h
blob: 73f32151d4188047b84bfa32cf05a2e7f779f8af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include <random>

namespace utility {

class Random {
	public:
		class Range {
			public:
				std::size_t get();

			protected:
				friend class Random;

				Range(std::mt19937* const, const std::size_t, const std::size_t);

			private:
				std::mt19937* const                        generator_;
				std::uniform_int_distribution<std::size_t> distribution_;
		};

		Random();

		Range makeRange(const std::size_t a, const std::size_t b);

	private:
		std::random_device device_;
		std::mt19937       generator_;

};


}