• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // Copyright (C) 2008-2018 Lorenzo Caminiti
3 // Distributed under the Boost Software License, Version 1.0 (see accompanying
4 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
5 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
6 
7 //[meyer97_stack4_main
8 #include "stack4.hpp"
9 #include <cassert>
10 
main()11 int main() {
12     stack4<int> s(3);
13     assert(s.capacity() == 3);
14     assert(s.count() == 0);
15     assert(s.empty());
16     assert(!s.full());
17 
18     s.put(123);
19     assert(!s.empty());
20     assert(!s.full());
21     assert(s.item() == 123);
22 
23     s.remove();
24     assert(s.empty());
25     assert(!s.full());
26 
27     return 0;
28 }
29 //]
30 
31