mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 23:36:11 +01:00
Fixed RNG issue with pre C++14 compilers
This commit is contained in:
parent
ac220289a6
commit
1aa6c91e64
@ -37,10 +37,11 @@ namespace Catch {
|
|||||||
#endif
|
#endif
|
||||||
template<typename V>
|
template<typename V>
|
||||||
static void shuffle( V& vector ) {
|
static void shuffle( V& vector ) {
|
||||||
|
RandomNumberGenerator rng;
|
||||||
#ifdef CATCH_CPP14_OR_GREATER
|
#ifdef CATCH_CPP14_OR_GREATER
|
||||||
std::shuffle( vector.begin(), vector.end(), RandomNumberGenerator() );
|
std::shuffle( vector.begin(), vector.end(), rng );
|
||||||
#else
|
#else
|
||||||
std::random_shuffle( vector.begin(), vector.end(), RandomNumberGenerator() );
|
std::random_shuffle( vector.begin(), vector.end(), rng );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user