diff options
author | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-30 19:58:45 +0000 |
---|---|---|
committer | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-30 19:58:45 +0000 |
commit | 35c5b43a66eb2217f3d3e68a73dd8cb9373ff311 (patch) | |
tree | 44bfdf01ad1c2aed39ece1a78ff9dc240f78c88b /ace/Containers.cpp | |
parent | 731964b3ed0c50c308a89a72b44a1489b10faf49 (diff) | |
download | ATCD-35c5b43a66eb2217f3d3e68a73dd8cb9373ff311.tar.gz |
Corrected the problem of ACE_Unbounded_Stack's size.
Diffstat (limited to 'ace/Containers.cpp')
-rw-r--r-- | ace/Containers.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ace/Containers.cpp b/ace/Containers.cpp index 0d7c2d0808d..1aa28d273d6 100644 --- a/ace/Containers.cpp +++ b/ace/Containers.cpp @@ -156,6 +156,8 @@ ACE_Unbounded_Stack<T>::delete_all_nodes (void) this->allocator_->free (temp); } + this->cur_size_ = 0; + ACE_ASSERT (this->head_ == this->head_->next_ && this->is_empty ()); } @@ -178,11 +180,13 @@ ACE_Unbounded_Stack<T>::copy_all_nodes (const ACE_Unbounded_Stack<T> &s) ACE_Node<T> (s_temp->item_, temp->next_)); temp = temp->next_; } + this->cur_size_ = s.cur_size_; } template<class T> ACE_Unbounded_Stack<T>::ACE_Unbounded_Stack (const ACE_Unbounded_Stack<T> &s) : head_ (0), + cur_size_ (0), allocator_ (s.allocator_) { if (this->allocator_ == 0) @@ -229,6 +233,7 @@ ACE_Unbounded_Stack<T>::push (const T &new_item) ACE_Node<T> (new_item, this->head_->next_), -1); this->head_->next_ = temp; + this->cur_size_++; return 0; } @@ -246,6 +251,7 @@ ACE_Unbounded_Stack<T>::pop (T &item) this->head_->next_ = temp->next_; this->allocator_->free (temp); + this->cur_size_--; return 0; } } |