From 13a74602bd4c46149da9949d448387a40b8ebd1c Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 25 Jun 2023 20:01:32 +1000 Subject: Upgrade to C++17 --- source/core/StarRandom.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/core/StarRandom.hpp') diff --git a/source/core/StarRandom.hpp b/source/core/StarRandom.hpp index b3c8ba2..c39f6ef 100644 --- a/source/core/StarRandom.hpp +++ b/source/core/StarRandom.hpp @@ -187,7 +187,8 @@ typename Container::value_type RandomSource::randValueFrom( template void RandomSource::shuffle(Container& container) { - std::random_shuffle(container.begin(), container.end(), [this](size_t max) { return randUInt(max - 1); }); + size_t max = container.size(); + std::shuffle(container.begin(), container.end(), URBG([this, max]() { return randUInt(max - 1); })); } template @@ -208,7 +209,8 @@ typename Container::value_type Random::randValueFrom( template void Random::shuffle(Container& container) { - std::random_shuffle(container.begin(), container.end(), [](size_t max) { return Random::randUInt(max - 1); }); + size_t max = container.size(); + std::shuffle(container.begin(), container.end(), URBG([max]() { return Random::randUInt(max - 1); })); } } -- cgit v1.2.3