//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // requires ShuffleIterator && LessThanComparable // void // make_heap(Iter first, Iter last); #include #include #include std::mt19937 randomness; void test(int N) { int* ia = new int [N]; for (int i = 0; i < N; ++i) ia[i] = i; std::shuffle(ia, ia+N, randomness); std::make_heap(ia, ia+N); assert(std::is_heap(ia, ia+N)); delete [] ia; } int main() { test(0); test(1); test(2); test(3); test(10); test(1000); }