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>
21 #include "min_allocator.h"
26 typedef typename C::value_type T;
27 typedef std::vector<T> V;
29 for (int i = 0; i < N; ++i)
31 std::random_shuffle(v.begin(), v.end());
32 C c(v.begin(), v.end());
33 c.sort(std::greater<T>());
34 assert(distance(c.begin(), c.end()) == N);
35 typename C::const_iterator j = c.begin();
36 for (int i = 0; i < N; ++i, ++j)
42 for (int i = 0; i < 40; ++i)
43 test<std::forward_list<int> >(i);
44 #if __cplusplus >= 201103L
45 for (int i = 0; i < 40; ++i)
46 test<std::forward_list<int, min_allocator<int>> >(i);