//mystk7.h --- CopyLeft by tsaiwn@csie.nctu.edu.tw // --- implement a Stack using in C++ STL class library #include using namespace std; template class MyStack { list x; public: void push(const T& y) { x.push_front(y); } T top( ) { return x.front( ); } void pop( ) { x.pop_front( ); } bool empty( ) { return x.begin() == x.end(); } };