Advertisement
AntonyZhilin

Untitled

Aug 30th, 2024
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. Index: userver/universal/src/utils/boost_uuid4.cpp
  2. IDEA additional info:
  3. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  4. <+>UTF-8
  5. ===================================================================
  6. diff --git a/userver/universal/src/utils/boost_uuid4.cpp b/userver/universal/src/utils/boost_uuid4.cpp
  7. --- a/userver/universal/src/utils/boost_uuid4.cpp
  8. +++ b/userver/universal/src/utils/boost_uuid4.cpp
  9. @@ -101,10 +101,20 @@
  10. return u;
  11. }
  12.  
  13. +struct LocalRandomPtr final {
  14. + using result_type = uint32_t;
  15. +
  16. + result_type operator()() { return random(); }
  17. +
  18. + static constexpr result_type min() { return RandomBase::min(); }
  19. + static constexpr result_type max() { return RandomBase::max(); }
  20. +
  21. + RandomBase& random{
  22. + WithDefaultRandom([](RandomBase& rng) -> auto& { return rng; })};
  23. +};
  24. +
  25. compiler::ThreadLocal local_uuid_generator = [] {
  26. - return WithDefaultRandom([](RandomBase& rng) {
  27. - return boost::uuids::basic_random_generator<RandomBase>(rng);
  28. - });
  29. + return boost::uuids::basic_random_generator<LocalRandomPtr>();
  30. };
  31.  
  32. } // namespace
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement