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 #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
} }
}; };