Ticket #6189: 1.cpp

File 1.cpp, 558 bytes (added by spolitov@…, 11 years ago)

minimal example to reproduce the issue

Line 
1#include <boost/random/mersenne_twister.hpp>
2#include <boost/random/uniform_int.hpp>
3#include <iostream>
4
5using boost::mt19937;
6using boost::uniform_int;
7
8class MGen {
9public:
10 typedef mt19937::result_type result_type;
11
12 result_type min() const { return impl_.min(); }
13 result_type max() const { return impl_.max(); }
14
15 result_type operator()()
16 {
17 return 2114502989;
18 }
19private:
20 mt19937 impl_;
21};
22
23int main()
24{
25 typedef boost::int64_t number;
26 MGen gen;
27 std::cout << uniform_int<number>(-50, 50)(gen) << std::endl;
28}
29