Skip to content

Commit

Permalink
Provide PCG32::result_type
Browse files Browse the repository at this point in the history
Provide result_type member type in PCG32, which makes it compatible with C++ UniformRandomBitGenerator and, as result, makes it usable in std::shuffle (which deprecated std::random_shuffle calls in Spring should be replaced with).
  • Loading branch information
AMDmi3 authored Apr 26, 2021
1 parent 8c0104a commit fc61592
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rts/System/GlobalRNG.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ struct PCG32 {
typedef uint32_t res_type;
typedef uint64_t val_type;

using result_type = res_type;

PCG32(const val_type _val = def_val, const val_type _seq = def_seq) { seed(_val, _seq); }
PCG32(const PCG32& rng) { *this = rng; }

Expand Down

0 comments on commit fc61592

Please sign in to comment.