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
This commit is contained in:
Sebastian Grottel 2017-10-15 18:30:40 +02:00 committed by Martin Hořeňovský
parent 664cbf702c
commit 296955c437

View File

@ -22,7 +22,7 @@
namespace Catch { namespace Catch {
struct RandomNumberGenerator { struct RandomNumberGenerator {
typedef std::ptrdiff_t result_type; typedef unsigned int result_type;
result_type operator()( result_type n ) const { return std::rand() % n; } result_type operator()( result_type n ) const { return std::rand() % n; }