子牛 发表于 2012-5-22 15:01:13

ACE_Unbounded_Set_Ex<T, C>::insert_tail (const T &item)请教


template <class T, class C> int
ACE_Unbounded_Set_Ex<T, C>::insert_tail (const T &item)
{
// ACE_TRACE ("ACE_Unbounded_Set_Ex<T, C>::insert_tail");
NODE *temp = 0;

// Insert <item> into the old dummy node location.
this->head_->item_ = item;

// Create a new dummy node.
ACE_NEW_MALLOC_RETURN (temp,
                         static_cast<NODE*> (this->allocator_->malloc (sizeof (NODE))),
                         NODE (this->head_->next_),
                         -1);
// Link this pointer into the list.
this->head_->next_ = temp;

// Point the head to the new dummy node.
this->head_ = temp;

++this->cur_size_;
return 0;
}这个函数做的是插入节点的动作,但是总感觉不对,请高手指点,这个链表的Head是在哪里的啊
页: [1]
查看完整版本: ACE_Unbounded_Set_Ex<T, C>::insert_tail (const T &item)请教