File indexing completed on 2025-07-03 08:32:07
0001 #ifndef BOOST_UUID_DETAIL_RANDOM_PROVIDER_HPP_INCLUDED
0002 #define BOOST_UUID_DETAIL_RANDOM_PROVIDER_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009 #include <boost/uuid/detail/random_device.hpp>
0010 #include <random>
0011 #include <cstdint>
0012
0013 namespace boost {
0014 namespace uuids {
0015 namespace detail {
0016
0017 class random_provider
0018 {
0019 private:
0020
0021 detail::random_device dev_;
0022
0023 public:
0024
0025 using result_type = std::uint32_t;
0026
0027 random_provider() = default;
0028
0029
0030
0031
0032 template<class Iter>
0033 void generate(Iter first, Iter last)
0034 {
0035 std::uniform_int_distribution<std::uint32_t> dist;
0036
0037 for( ; first != last; ++first )
0038 {
0039 *first = dist( dev_ );
0040 }
0041 }
0042
0043 const char * name() const
0044 {
0045 return "std::random_device";
0046 }
0047 };
0048
0049 }
0050 }
0051 }
0052
0053 #endif