Skip to content

Commit

Permalink
Fixed vector's reinsert
Browse files Browse the repository at this point in the history
  • Loading branch information
Alinshans committed Jun 27, 2019
1 parent 62ef9ef commit cbfbfaf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions MyTinySTL/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ void vector<T>::reinsert(size_type size)
data_allocator::deallocate(new_begin, size);
throw;
}
data_allocator::deallocate(begin_, cap_ - begin_);
begin_ = new_begin;
end_ = begin_ + size;
cap_ = begin_ + size;
Expand Down

0 comments on commit cbfbfaf

Please sign in to comment.