阅读背景:

C++模板类+嵌套类实例

来源:互联网 

queue.h

#ifndef QUEUE_H_

#define QUEUE_H_

template<class Type>
class Queue{
private:
    enum {Q_SIZE = 10};
    class Node{
    public:
        Type data;
        Node * next;
        Node(const Type data) : data(data), next(0) {}
    };  
    Node *front;
    Node *rear;
    int curSize;
    int maxSize;
public:
    Queue(int size = Q_SIZE);
    ~Queue();
    bool isFull() const;
    bool isEmpty() const ;
    bool enQueue(const Type data);
    bool deQueue();
    void tarverseQueue() const;
};

#endif#ifndef QUEUE_H_

#define QUEUE_H_



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: