YarrPP  0.1
C++ Library for Pirates
random.hpp
Go to the documentation of this file.
1 
6 #include <yarr/config.hpp>
7 
8 #include <cstdint>
9 #include <random>
10 
11 namespace yarr
12 {
13 
15 void random_fill(char* begin, char* end);
16 
24 {
25 public:
26  using result_type = std::uint32_t;
27 
28 public:
29  void generate(result_type* begin, result_type* end)
30  {
31  random_fill(reinterpret_cast<char*>(begin), reinterpret_cast<char*>(end));
32  }
33 };
34 
45 template <typename TRandomNumberEngine>
46 TRandomNumberEngine random_seeded()
47 {
48  random_seed_seq rss;
49  return TRandomNumberEngine(rss);
50 }
51 
52 }