1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class Compare> void sort(Compare comp);
14 #include <forward_list>
22 #include "min_allocator.h"
24 std::mt19937 randomness;
29 typedef typename C::value_type T;
30 typedef std::vector<T> V;
32 for (int i = 0; i < N; ++i)
34 std::shuffle(v.begin(), v.end(), randomness);
35 C c(v.begin(), v.end());
36 c.sort(std::greater<T>());
37 assert(distance(c.begin(), c.end()) == N);
38 typename C::const_iterator j = c.begin();
39 for (int i = 0; i < N; ++i, ++j)
45 for (int i = 0; i < 40; ++i)
46 test<std::forward_list<int> >(i);
47 #if TEST_STD_VER >= 11
48 for (int i = 0; i < 40; ++i)
49 test<std::forward_list<int, min_allocator<int>> >(i);