/////////////////////////////////////////////////////////////////// // queue.cpp - Solution of MT#2-Q1 // // // // This is a demo showing how to make the required declarations // // It provides no useful functionality. Main does nothing other // // Than create a node and a queue object. // /////////////////////////////////////////////////////////////////// #include /* hook class for application specific processing */ class operation { public: virtual ~operation(); virtual void doOp() = 0; }; /* Note: no copy, destruction, or assignment operations are needed. Compiler generated versions work correctly. */ template class queue { public: queue(); void enqueue(const T& t); T dequeue(operation& op); private: typedef std::list queueList; queueList _ql; }; // Note: Use list since enqueue on one end and dequeue on other end. template queue::queue() {} int main() { queue q; }