I get errors for the below code when I try to compile that tell me the following:
'isEmpty' : is not a member of '_Stack'
Error while compiling class template member function 'void QueueS::enqueue(const T &)
#include <iostream> #include <stack> using namespace std; template <class T> class _Stack : public stack<T> { public: T pop(){ T tmp=stack::top(); stack::pop(); return tmp; } }; template <class T> class QueueS { public: QueueS(){} bool isEmpty() const{ } void enqueue(const T& el){ while (!output.isEmpty()) { input.push(ouput.pop()); } input.push(el); } private: _Stack<T> input; _Stack<T> output; };
I'm not sure what's going on. Can anyone offer any assistance? I have obviously not implemented isEmpty yet. Was wondering if that should have an effect.