// conversion factory
template <typename T, typename It>
-static inline std::move_iterator<Transformer<T, It>>
+inline std::move_iterator<Transformer<T, It>>
conversionIterator(const It& it) {
return std::make_move_iterator(Transformer<T, It>(it));
}
#include <folly/Synchronized.h>
-static const auto seed = folly::randomNumberSeed();
-typedef std::mt19937 RandomT;
-static RandomT rng(seed);
+inline std::mt19937& getRNG() {
+ static const auto seed = folly::randomNumberSeed();
+ static std::mt19937 rng(seed);
+ return rng;
+}
template <class Integral1, class Integral2>
Integral2 random(Integral1 low, Integral2 up) {
std::uniform_int_distribution<> range(low, up);
- return range(rng);
+ return range(getRNG());
}
template <class Mutex>