Skip to content

Commit

Permalink
RandomNumberGenerator::result_type should be unsigned (#1050)
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
sgrottel authored and horenmar committed Oct 31, 2017
1 parent e68485e commit 96c5de6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/internal/catch_random_number_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit 96c5de6

Please sign in to comment.