class IntListStack { private: class SNode { public: SNode (int data, SNode *next) { this -> data = data; this -> next = next; } int data; SNode *next; }; SNode *head; // head pointer for the linked list bool elastic; // true if stack is elastic (has infinite capacity) int capacity; // stack capacity (only meaningful if "elastic" is false) int count; // number of values on stack public: // creates an "elastic" stack IntListStack (); // creates a stack with a fixed capacity IntListStack (int capacity); IntListStack (const IntListStack &otherStack); ~IntListStack (); // throws an "overflow_error" exception if the stack has a fixed // capacity and is full. void push (int value); // throws an "overflow_error" exception if the stack is empty int pop (); bool isEmpty() const { return count == 0; } int getcount() const { return count; } // copies contents only (capacity attributes are not copied). // throws an "overflow_error" exception if the destination stack // has a fixed capacity and this is not large enough. IntListStack& operator= (const IntListStack &otherStack); };