c07p359.txt

来自「Data Abstraction & Problem Solving with 」· 文本 代码 · 共 43 行

TXT
43
字号
template <class T, class Container = deque <T> >class queue{public:   explicit queue(const Container& cnt = Container());   // Default constructor, initializes an empty queue.   // Precondition: None.   // Postcondition: An empty queue exists.   bool empty() const;   // Determines if the queue is empty.   // Precondition: None.   // Postcondition: Returns true if the queue is empty,    // otherwise returns false.   size_type size() const;   // Determines the size of the queue. size_type is   // an integral type.   // Precondition: None.   // Postcondition: Returns the number of items that    // are currently in the queue.   T &front();   // Returns a reference to the first item in the queue.   // Precondition: None.   // Postcondition: The item is not removed from the queue.   T &back();   // Returns a reference to the last item in the queue.   // Precondition: None.   // Postcondition: The item is not removed from the queue.   void pop();   // Removes the first item in the queue.   // Precondition: None.   // Postcondition: The item at the front of the queue is    // removed.   void push(const T& x);   // Inserts an item at the back of the queue.   // Precondition: None.   // Postcondition: The item x is at the back of the queue.} // end STL queue

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?