Fixed RNG issue with pre C++14 compilers

This commit is contained in:
Phil Nash 2016-06-09 19:07:05 +01:00
parent ac220289a6
commit 1aa6c91e64

View File

@ -37,10 +37,11 @@ namespace Catch {
#endif
template<typename V>
static void shuffle( V& vector ) {
RandomNumberGenerator rng;
#ifdef CATCH_CPP14_OR_GREATER
std::shuffle( vector.begin(), vector.end(), RandomNumberGenerator() );
std::shuffle( vector.begin(), vector.end(), rng );
#else
std::random_shuffle( vector.begin(), vector.end(), RandomNumberGenerator() );
std::random_shuffle( vector.begin(), vector.end(), rng );
#endif
}
};