#include #include #include "stacke.h" using namespace std; stacke::~stacke() { if (size() != 0) { cerr << "Warning: stack still contains " << size() << " values.\n"; } } void stacke::push(int i) { if (size() >= capacity()) { cerr << "Can't push when size " << size() << " >= capacity " << capacity() << ".\n"; exit(EXIT_FAILURE); } ::stack::push(i); } int stacke::pop() { if (size() == 0) { cerr << "Can't pop when size " << size() << " == 0.\n"; exit(EXIT_FAILURE); } return ::stack::pop(); }