18 floatStack.
push(7.7F);
19 std::cout << floatStack.
top() << std::endl;
21 std::cout << floatStack.
top() << std::endl;
23 std::cout << floatStack.
top() << std::endl;
25 }
catch (std::exception
const& ex) {
26 std::cerr <<
"Exception: " << ex.what() << std::endl;
32 std::cout << vStack.
top() << std::endl;
void pop()
Pop element off the stack.
void push(const T &e)
Pushes element onto stack.
Demonstrate use of member function templates.
Stack class using vector as element container.
T top() const
Return top element of the stack (but not pop-ing it).