fix push_back reserve growth

This commit is contained in:
hugogogo
2022-06-03 19:49:09 +02:00
parent 7d857c5e4e
commit 556807669e
3 changed files with 125 additions and 78 deletions

View File

@@ -33,9 +33,9 @@ public:
explicit vector (const allocator_type & alloc = allocator_type());
explicit vector (size_type n, const value_type& val = value_type(),
const allocator_type& alloc = allocator_type());
// template <class InputIterator>
// vector (InputIterator first, InputIterator last,
// const allocator_type& alloc = allocator_type());
template <class InputIterator>
vector (InputIterator first, InputIterator last,
const allocator_type& alloc = allocator_type());
vector( vector const & src );
// destructor --------------------------------
~vector();
@@ -95,8 +95,8 @@ public:
* modifiers :
*************/
// assign ------------------------------------
//template <class InputIterator>
// void assign(InputIterator first, InputIterator last);
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
void assign(size_type n, const value_type& val);
// push_back ---------------------------------
void push_back(const value_type & val);
@@ -113,7 +113,7 @@ public:
// swap --------------------------------------
//void swap(vector& x);
// clear -------------------------------------
//void clear();
void clear();
private:
@@ -129,9 +129,8 @@ private:
//std::ostream & operator<<(std::ostream & o, vector const & rhs);
}
} // namespace ft
# include "vector.tpp"
#endif