Fixed issue - "Static_assert failed due to requirement '__libcpp_random_is_valid_urng<Catch::RandomNumberGenerator, void>::value' """, because of C++ Standard Library deprecations in Xcode 14.3

This commit is contained in:
Dmytro Romanov 2023-04-20 15:16:15 +02:00
parent 4724373abb
commit ae7202d7a5

View File

@ -6472,10 +6472,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(), rng );
std::shuffle( vector.begin(), vector.end(), std::default_random_engine{std::random_device{}()} );
#else
RandomNumberGenerator rng;
std::random_shuffle( vector.begin(), vector.end(), rng );
#endif
}