Rename random::random_device -> random::device

This commit is contained in:
Nikita Lisitsa 2021-02-15 12:24:43 +03:00
parent e2bcab4f89
commit b6aa09bffe
4 changed files with 7 additions and 7 deletions

View file

@ -678,7 +678,7 @@ struct animation_2d_app
std::optional<std::size_t> selected;
float selected_s = 0.f;
random::generator rng{random::random_device{}};
random::generator rng{random::device{}};
async::threadpool bg{"bg"};

View file

@ -220,7 +220,7 @@ struct cloud_app
{
async::threadpool bg("bg");
random::generator rng(random::random_device{});
random::generator rng(random::device{});
random::uniform_sphere_vector_distribution<float, 3> d;
std::vector<util::array<geom::vector<float, 3>, 3>> grad(4);

View file

@ -198,7 +198,7 @@ candle_renderer::candle_renderer()
void candle_renderer::add(geom::point<float, 3> const & pos, geom::vector<float, 3> const & dir, float size)
{
random::generator rng{random::random_device{}};
random::generator rng{random::device{}};
random::uniform_sphere_vector_distribution<float, 2> d;
geom::vector<float, 2> noise_offset;
while (true)

View file

@ -5,11 +5,11 @@
namespace psemek::random
{
using random_device = boost::random_device;
using device = boost::random_device;
// check that random_device::result_type is basically std::uint32_t
static_assert(std::is_integral_v<random_device::result_type>);
static_assert(std::is_unsigned_v<random_device::result_type>);
static_assert(sizeof(random_device::result_type) == 4);
static_assert(std::is_integral_v<device::result_type>);
static_assert(std::is_unsigned_v<device::result_type>);
static_assert(sizeof(device::result_type) == 4);
}