Advertisement
WsumrakW

BaseStack

May 26th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. template <typename ItemType>
  2. class BaseStack
  3. {
  4. public:
  5.     BaseStack() {}
  6.     virtual BaseStack<ItemType>& push(const ItemType& item) = 0;
  7.     virtual BaseStack<ItemType>& pop() = 0;
  8.     virtual ItemType& peek() = 0;
  9.     virtual const ItemType& peek() const = 0;
  10.     virtual int length() const = 0;
  11.     virtual bool isEmpty() const = 0;
  12.     virtual ~BaseStack() {}
  13. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement