diff options
Diffstat (limited to 'test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp')
-rw-r--r-- | test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp index c2805a656137..acede6ff7b56 100644 --- a/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp +++ b/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp @@ -15,10 +15,13 @@ // minmax_element(Iter first, Iter last); #include <algorithm> +#include <random> #include <cassert> #include "test_iterators.h" +std::mt19937 randomness; + template <class Iter> void test(Iter first, Iter last) @@ -46,7 +49,7 @@ test(int N) int* a = new int[N]; for (int i = 0; i < N; ++i) a[i] = i; - std::random_shuffle(a, a+N); + std::shuffle(a, a+N, randomness); test(Iter(a), Iter(a+N)); delete [] a; } @@ -66,7 +69,7 @@ test() int* a = new int[N]; for (int i = 0; i < N; ++i) a[i] = 5; - std::random_shuffle(a, a+N); + std::shuffle(a, a+N, randomness); std::pair<Iter, Iter> p = std::minmax_element(Iter(a), Iter(a+N)); assert(base(p.first) == a); assert(base(p.second) == a+N-1); |