From ae7202d7a5c84f7ce688745570d51e9bd426be42 Mon Sep 17 00:00:00 2001 From: Dmytro Romanov Date: Thu, 20 Apr 2023 15:16:15 +0200 Subject: [PATCH] Fixed issue - "Static_assert failed due to requirement '__libcpp_random_is_valid_urng::value' """, because of C++ Standard Library deprecations in Xcode 14.3 --- catch/catch.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/catch/catch.hpp b/catch/catch.hpp index a11ecce..cd1db4f 100644 --- a/catch/catch.hpp +++ b/catch/catch.hpp @@ -6472,10 +6472,11 @@ namespace Catch { #endif template 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 }