Skip to content

Commit

Permalink
Replace last use of std::uniform_int_distribution with our own
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
horenmar committed Apr 2, 2024
1 parent ae4baf8 commit 21b53f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/catch2/benchmark/detail/catch_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Catch {
double const* last,
Estimator& estimator ) {
auto n = static_cast<size_t>( last - first );
std::uniform_int_distribution<size_t> dist( 0, n - 1 );
Catch::uniform_integer_distribution<size_t> dist( 0, n - 1 );

sample out;
out.reserve( resamples );
Expand Down

0 comments on commit 21b53f9

Please sign in to comment.