#include using namespace std; template class Stack : public stack { public: /* --- Add several copies of a value to the stack if there is room--- * * Receive: The BoundedStack containing this function * (implicitly) * A value to be added to a BoundedStack, and * number of times value is to be added * Pass back: The BoundedStack (implicitly), with value added * number times at its top, provided there is room * Output: Overflow message if no room for value **************************************************************/ void RepeatedPush(const ElementType & value, int number); }; // Definition of RepeatedPush() template inline void Stack:: RepeatedPush(const ElementType & value, int number) { for (int i = 1; i <= number; i++) push(value); }