summaryrefslogtreecommitdiffstats
path: root/libcxx/test/containers/sequences/container.adaptors/stack/stack.defn/push.pass.cpp
blob: 17fc58da8af5b8f9d9695114e0add5cc71244858 (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
//===----------------------------------------------------------------------===//
//
// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <stack>

// void push(const value_type& v);

#include <stack>
#include <cassert>

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