不知道哪里出错了总是没有输出
```c++
#include <iostream>
using namespace std;
template<typename DataType>
struct Node
{
DataType data;
Node* next;
};
template<typename DataType>
class CirQueue
{
public:
CirQueue()
{
rear=nullptr;
};
~CirQueue(){};
void EnQueue( DataType x)
{
Node<int>* p=nullptr;
p=new Node<DataType>;
p->data=x;
if(rear=nullptr)
{
p->next=p;
rear=p;
}
else
{
p->next=rear->next;
rear->next=p;
rear=p;
}
}
DataType DeQueue()
{
int x;
Node<int>* p=nullptr;
if(rear=nullptr) return 0;
else if(rear->next==rear)
{
x=rear->data;
delete rear;
rear=nullptr;
return x;
}
else{
p=rear->next;
x=p->data;
rear->next=p->next;
delete p;
return x;
}
}
private:
Node<DataType>* rear;
};
int main()
{
CirQueue<int> q;
q.EnQueue(1);
q.EnQueue(2);
q.EnQueue(3);
cout<<q.DeQueue()<<endl;
}
```