Stop using random_shuffle in the libc++ test suite. It's going to be removed in c++17. Use shuffle() instead. No change to libc++, just the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,10 +15,13 @@
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <random>
|
||||
#include <cassert>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
std::mt19937 randomness;
|
||||
|
||||
template <class C>
|
||||
void test(int N)
|
||||
{
|
||||
@@ -27,7 +30,7 @@ void test(int N)
|
||||
V v;
|
||||
for (int i = 0; i < N; ++i)
|
||||
v.push_back(i);
|
||||
std::random_shuffle(v.begin(), v.end());
|
||||
std::shuffle(v.begin(), v.end(), randomness);
|
||||
C c(v.begin(), v.end());
|
||||
c.sort();
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
|
||||
@@ -16,10 +16,13 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <random>
|
||||
#include <cassert>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
std::mt19937 randomness;
|
||||
|
||||
template <class C>
|
||||
void test(int N)
|
||||
{
|
||||
@@ -28,7 +31,7 @@ void test(int N)
|
||||
V v;
|
||||
for (int i = 0; i < N; ++i)
|
||||
v.push_back(i);
|
||||
std::random_shuffle(v.begin(), v.end());
|
||||
std::shuffle(v.begin(), v.end(), randomness);
|
||||
C c(v.begin(), v.end());
|
||||
c.sort(std::greater<T>());
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
|
||||
Reference in New Issue
Block a user