diff --git a/src/sfall_arrays.cc b/src/sfall_arrays.cc index d8ba240..717aebf 100644 --- a/src/sfall_arrays.cc +++ b/src/sfall_arrays.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,9 @@ static void ListSort(std::vector& arr, int type, Compare cmp) std::reverse(arr.rbegin(), arr.rend()); break; case ARRAY_ACTION_SHUFFLE: // shuffle elements - std::random_shuffle(arr.rbegin(), arr.rend()); + std::random_device rd; + std::mt19937 g(rd()); + std::shuffle(arr.begin(), arr.end(), g); break; } }