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<RandomAccessIterator Iter>
13 // requires ShuffleIterator<Iter> && LessThanComparable<Iter::value_type>
15 // pop_heap(Iter first, Iter last);
22 int* ia = new int [N];
23 for (int i = 0; i < N; ++i)
25 std::random_shuffle(ia, ia+N);
26 std::make_heap(ia, ia+N);
27 for (int i = N; i > 0; --i)
29 std::pop_heap(ia, ia+i);
30 assert(std::is_heap(ia, ia+i-1));
32 std::pop_heap(ia, ia);