Node::Node()
{
}
Node& Node::operator=(const Node&ths)
{
this->_q = ths._q;
return *this;
}
//void Node::Destroy()
//{
//
//}
Node::~Node()
{
std::cout<<"my destroy"<<std::endl;
int *p = NULL;
while (!_q.empty())
{
p = _q.front();
_q.pop();
delete p;
}
//this->Destroy();
}
void Node::Show()
{
int *p = NULL;
size_t size = _q.size();
while(size--)
{
p = _q.front();
std::cout<<*p<<std::endl;
_q.push(p);
_q.pop();
}
}
代码有点乱,自行整理, 重点是展示了一下 Node(const Node &r) 拷贝构造函数。