From 96c5de678d538e4e9b95c7f06afa03e3d0a0b15e Mon Sep 17 00:00:00 2001 From: Sebastian Grottel Date: Sun, 15 Oct 2017 18:30:40 +0200 Subject: [PATCH] `RandomNumberGenerator::result_type` should be unsigned (#1050) `result_type` must be unsigned: http://en.cppreference.com/w/cpp/concept/UniformRandomBitGenerator Using a signed type causes an infinite loop working with MS Visual Studio 2017, targetting: v140, WindowsTargetPlatformVersion 10.0.15063.0, Debug, x64 --- include/internal/catch_random_number_generator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_random_number_generator.h b/include/internal/catch_random_number_generator.h index 1a61202d..2395bd39 100644 --- a/include/internal/catch_random_number_generator.h +++ b/include/internal/catch_random_number_generator.h @@ -20,7 +20,7 @@ namespace Catch { unsigned int rngSeed(); struct RandomNumberGenerator { - using result_type = std::ptrdiff_t; + using result_type = unsigned int; static constexpr result_type (min)() { return 0; } static constexpr result_type (max)() { return 1000000; }