Vcsn  2.4
Be Rational
random.cc
Go to the documentation of this file.
1 #include <vcsn/misc/random.hh>
2 
3 namespace vcsn
4 {
6  std::mt19937& make_random_engine()
7  {
8  static auto res = []
9  {
10  if (getenv("VCSN_SEED"))
11  return std::mt19937{std::mt19937::default_seed};
12  else
13  {
14  std::random_device rd;
15  return std::mt19937{rd()};
16  }
17  }();
18  return res;
19  }
20 }
return res
Definition: multiply.hh:398
std::mt19937 & make_random_engine()
Generate a unique random device.
Definition: random.cc:6
Definition: a-star.hh:8