Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
stack5.cpp
Go to the documentation of this file.
1 
7 #include "stack5.hpp"
8 #include <iostream>
9 
10 int main()
11 {
12  try {
13  Stack<int> intStack;
14  Stack<double> doubleStack;
15  intStack.push(42);
16  intStack.push(7);
17  doubleStack.push(7.7);
18  doubleStack = intStack;
19  std::cout << doubleStack.top() << std::endl;
20  doubleStack.pop();
21  } catch (std::exception const& ex) {
22  std::cerr << "Exception: " << ex.what() << std::endl;
23  return EXIT_FAILURE;
24  }
25  return 0;
26 }
void pop()
Pop element off the stack.
Definition: stack1.hpp:43
void push(const T &e)
Pushes element onto stack.
Definition: stack1.hpp:52
Stack class using vector as element container.
Definition: stack1.hpp:15
Template function returns maximum.
T top() const
Return top element of the stack (but not pop-ing it).
Definition: stack1.hpp:58
int main()
Definition: stack5.cpp:10