From 541c85bc4ef96faa593674d1aa507dba729ab695 Mon Sep 17 00:00:00 2001 From: ofTheo Date: Fri, 21 Jul 2023 11:16:43 -0700 Subject: [PATCH] bugfix random_shuffle is removed in C++17 - replace with std::shuffle --- libs/openFrameworks/utils/ofUtils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/openFrameworks/utils/ofUtils.h b/libs/openFrameworks/utils/ofUtils.h index 2e807588403..42074590ab4 100644 --- a/libs/openFrameworks/utils/ofUtils.h +++ b/libs/openFrameworks/utils/ofUtils.h @@ -13,6 +13,7 @@ #include #include #include +#include /// \section Elapsed Time /// \brief Reset the elapsed time counter. @@ -225,7 +226,8 @@ int ofGetWeekday(); /// \sa http://www.cplusplus.com/reference/algorithm/random_shuffle/ template void ofRandomize(std::vector& values) { - random_shuffle(values.begin(), values.end()); + //switch from random_shuffle ( removed in some C++17 impl ) + std::shuffle(values.begin(), values.end(), std::default_random_engine(0)); } /// \brief Conditionally remove values from a vector.