add capacity() and basic assign()

This commit is contained in:
hugogogo
2022-06-03 17:10:53 +02:00
parent aecd2caa1c
commit 7d857c5e4e
3 changed files with 127 additions and 47 deletions

View File

@@ -30,15 +30,13 @@ public:
* copliens :
************/
// constructor -------------------------------
// 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());
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());
// vector (const vector& x);
// TMP
vector();
// vector (InputIterator first, InputIterator last,
// const allocator_type& alloc = allocator_type());
vector( vector const & src );
// TMP END
// destructor --------------------------------
~vector();
// operator= ---------------------------------
@@ -71,7 +69,7 @@ public:
// resize ------------------------------------
//void resize(size_type n, value_type val = value_type());
// capacity ----------------------------------
//size_type capacity() const;
size_type capacity() const;
// empty -------------------------------------
//bool empty() const;
// reserve -----------------------------------
@@ -99,7 +97,7 @@ public:
// assign ------------------------------------
//template <class InputIterator>
// void assign(InputIterator first, InputIterator last);
//void assign(size_type n, const value_type& val);
void assign(size_type n, const value_type& val);
// push_back ---------------------------------
void push_back(const value_type & val);
// pop_back ----------------------------------