From bff6e35e2b239217f3940ed52429f94b745adc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 2 Apr 2024 18:13:15 +0200 Subject: [PATCH] Replace last use of std::uniform_int_distribution with our own Our implementation should be slightly faster, and has the advantage of being consistent between platforms. This does not have immediate user impact, because we currently use random_device to generate random seed for resampling, but if we decide to change this in the future, it is one less place to fix. --- src/catch2/benchmark/detail/catch_stats.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/catch2/benchmark/detail/catch_stats.cpp b/src/catch2/benchmark/detail/catch_stats.cpp index 52cee4ee..e6de359c 100644 --- a/src/catch2/benchmark/detail/catch_stats.cpp +++ b/src/catch2/benchmark/detail/catch_stats.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,7 @@ namespace Catch { double const* last, Estimator& estimator ) { auto n = static_cast( last - first ); - std::uniform_int_distribution dist( 0, n - 1 ); + Catch::uniform_integer_distribution dist( 0, n - 1 ); sample out; out.reserve( resamples );