summaryrefslogtreecommitdiffstats
path: root/libcxx/test/containers/container.adaptors/priority.queue/priqueue.members/pop.pass.cpp
blob: 202e19c8916a3f1cf75cfd3b1d05cbb4220b5ed6 (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
27
28
29
30
31
32
33
34
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <queue>

// priority_queue();

// void pop();

#include <queue>
#include <cassert>

int main()
{
    std::priority_queue<int> q;
    q.push(1);
    assert(q.top() == 1);
    q.push(3);
    assert(q.top() == 3);
    q.push(2);
    assert(q.top() == 3);
    q.pop();
    assert(q.top() == 2);
    q.pop();
    assert(q.top() == 1);
    q.pop();
    assert(q.empty());
}
OpenPOWER on IntegriCloud