summaryrefslogtreecommitdiffhomepage
path: root/src/random.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-27 07:29:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-27 12:37:20 +0100
commitf60c3734e38408b97e10e29a6c1d8780770d5b79 (patch)
tree20f778f31725b8960d13a04388757b2f53fa0164 /src/random.cpp
parent48b8e559cd72c95a5f72de625a608e85026e3785 (diff)
compat/prelude: add operator""_uz() for size_t
Diffstat (limited to 'src/random.cpp')
-rw-r--r--src/random.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/random.cpp b/src/random.cpp
index d3e45292..7888dbaa 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -17,13 +17,13 @@ std::size_t random_engine_impl::operator()()
{
if constexpr(sizeof(std::size_t) > sizeof(std::uint32_t))
{
- constexpr std::size_t N = (sizeof(std::size_t) + sizeof(std::uint32_t)-1) / sizeof(std::uint32_t);
+ constexpr auto N = (sizeof(std::size_t) + sizeof(std::uint32_t)-1) / sizeof(std::uint32_t);
static_assert(N >= 1);
union {
std::size_t x;
std::uint32_t a[N];
} ret;
- for (std::size_t i = 0; i < N; i++)
+ for (auto i = 0_uz; i < N; i++)
ret.a[i] = g();
return ret.x;
}