Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: userver/universal/src/utils/boost_uuid4.cpp
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- diff --git a/userver/universal/src/utils/boost_uuid4.cpp b/userver/universal/src/utils/boost_uuid4.cpp
- --- a/userver/universal/src/utils/boost_uuid4.cpp
- +++ b/userver/universal/src/utils/boost_uuid4.cpp
- @@ -101,10 +101,20 @@
- return u;
- }
- +struct LocalRandomPtr final {
- + using result_type = uint32_t;
- +
- + result_type operator()() { return random(); }
- +
- + static constexpr result_type min() { return RandomBase::min(); }
- + static constexpr result_type max() { return RandomBase::max(); }
- +
- + RandomBase& random{
- + WithDefaultRandom([](RandomBase& rng) -> auto& { return rng; })};
- +};
- +
- compiler::ThreadLocal local_uuid_generator = [] {
- - return WithDefaultRandom([](RandomBase& rng) {
- - return boost::uuids::basic_random_generator<RandomBase>(rng);
- - });
- + return boost::uuids::basic_random_generator<LocalRandomPtr>();
- };
- } // namespace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement