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 15, 2017
1 parent 664cbf7 commit 296955c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/internal/catch_test_case_registry_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace Catch {

struct RandomNumberGenerator {
typedef std::ptrdiff_t result_type;
typedef unsigned int result_type;

result_type operator()( result_type n ) const { return std::rand() % n; }

Expand Down

0 comments on commit 296955c

Please sign in to comment.