From b6aa09bffefa35fd2978efd345c002c55ec9f475 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Mon, 15 Feb 2021 12:24:43 +0300 Subject: [PATCH] Rename random::random_device -> random::device --- examples/animation_2d.cpp | 2 +- examples/cloud.cpp | 2 +- examples/fire.cpp | 2 +- libs/random/include/psemek/random/device.hpp | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/animation_2d.cpp b/examples/animation_2d.cpp index e5eb9355..9d177466 100644 --- a/examples/animation_2d.cpp +++ b/examples/animation_2d.cpp @@ -678,7 +678,7 @@ struct animation_2d_app std::optional selected; float selected_s = 0.f; - random::generator rng{random::random_device{}}; + random::generator rng{random::device{}}; async::threadpool bg{"bg"}; diff --git a/examples/cloud.cpp b/examples/cloud.cpp index 41a6605c..3716577d 100644 --- a/examples/cloud.cpp +++ b/examples/cloud.cpp @@ -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 d; std::vector, 3>> grad(4); diff --git a/examples/fire.cpp b/examples/fire.cpp index 05563392..0e7d4881 100644 --- a/examples/fire.cpp +++ b/examples/fire.cpp @@ -198,7 +198,7 @@ candle_renderer::candle_renderer() void candle_renderer::add(geom::point const & pos, geom::vector const & dir, float size) { - random::generator rng{random::random_device{}}; + random::generator rng{random::device{}}; random::uniform_sphere_vector_distribution d; geom::vector noise_offset; while (true) diff --git a/libs/random/include/psemek/random/device.hpp b/libs/random/include/psemek/random/device.hpp index 8453b590..f8804dda 100644 --- a/libs/random/include/psemek/random/device.hpp +++ b/libs/random/include/psemek/random/device.hpp @@ -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); - static_assert(std::is_unsigned_v); - static_assert(sizeof(random_device::result_type) == 4); + static_assert(std::is_integral_v); + static_assert(std::is_unsigned_v); + static_assert(sizeof(device::result_type) == 4); }