summaryrefslogtreecommitdiffstats
path: root/test/containers/sequences/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp.pass.cpp
blob: 87c29abd1775d5925ff611cebd1e67359a0f1817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//===----------------------------------------------------------------------===//
//
// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <queue>

// template <class InputIterator>
//   priority_queue(InputIterator first, InputIterator last, const Compare& comp);

#include <queue>
#include <cassert>

int main()
{
    int a[] = {3, 5, 2, 0, 6, 8, 1};
    int* an = a + sizeof(a)/sizeof(a[0]);
    std::priority_queue<int, std::vector<int>, std::greater<int> >
        q(a, an, std::greater<int>());
    assert(q.size() == an - a);
    assert(q.top() == 0);
}