Vector is a kind of sequence that supports random access iterators. In addition, it supports (amortized) constant time insert and erase operations at the end;
insert and erase in the middle take linear time. Storage management is handled automatically, though hints can be given to improve efficiency.
template <class T, template <class U> class Allocator = allocator>
class vector {
public:
// typedefs:
typedef iterator;
typedef const_iterator;
typedef Allocator::pointer pointer;
typedef Allocator::reference reference;
typedef Allocator::const_reference const_reference;
typedef size_type;
typedef difference_type;
typedef T value_type;
typedef reverse_iterator;
typedef const_reverse_iterator;
// allocation/deallocation:
vector();
vector(size_type n, const T& value = T());
vector(const vector& x);
template vector(InputIterator first, InputIterator last);
~vector();
vector& operator=(const vector& x);
void reserve(size_type n);
void swap(vector& x);
// accessors:
iterator begin();
const_iterator begin() const;
iterator end();
const_iterator end() const;
reverse_iterator rbegin();
const_reverse_iterator rbegin();
reverse_iterator rend();
const_reverse_iterator rend();
size_type size() const;
size_type max_size() const;
size_type capacity() const;
bool empty() const;
reference operator[](size_type n);
const_reference operator[](size_type n) const
reference front();
const_reference front() const;
reference back();
const_reference back() const;
// insert/erase:
void push_back(const T& x);
iterator insert(iterator position, const T& x = T());
void insert(iterator position, size_type n, const T& x);
template
void insert(iterator position, InputIterator first, InputIterator last);
void pop_back();
void erase(iterator position);
void erase(iterator first, iterator last);
};