mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
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:
parent
664cbf702c
commit
296955c437
@ -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; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user