aboutsummaryrefslogtreecommitdiff
path: root/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp')
-rw-r--r--test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp
index c6eaa8ccec86..003138099f5a 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap.pass.cpp
@@ -15,14 +15,17 @@
// sort_heap(Iter first, Iter last);
#include <algorithm>
+#include <random>
#include <cassert>
+std::mt19937 randomness;
+
void test(int N)
{
int* ia = new int [N];
for (int i = 0; i < N; ++i)
ia[i] = i;
- std::random_shuffle(ia, ia+N);
+ std::shuffle(ia, ia+N, randomness);
std::make_heap(ia, ia+N);
std::sort_heap(ia, ia+N);
assert(std::is_sorted(ia, ia+N));