allocator_type
·
begin
·
clear
·
const_iterator
·
const_reference
·
const_reverse_iterator
·
difference_type
·
empty
·
end
·
erase
·
get_allocator
·
iterator
·
max_size
·
rbegin
·
reference
·
rend
·
reverse_iterator
·
size
·
size_type
·
swap
·
value_type
template<class T, class A = allocator<T> >
class Cont {
public:
typedef A allocator_type;
typedef T0 size_type;
typedef T1 difference_type;
typedef T2 reference;
typedef T3 const_reference;
typedef T4 value_type;
typedef T5 iterator;
typedef T6 const_iterator;
typedef T7 reverse_iterator;
typedef T8 const_reverse_iterator;
iterator begin();
const_iterator begin() const;
iterator end();
const_iterator end() const;
reverse_iterator rbegin();
const_reverse_iterator rbegin() const;
reverse_iterator rend();
const_reverse_iterator rend() const;
size_type size() const;
size_type max_size() const;
bool empty() const;
A get_allocator() const;
iterator erase(iterator it);
iterator erase(iterator first, iterator last);
void clear();
void swap(Cont x);
protected:
A allocator;
};
The template class describes an object that controls a varying-length sequence of elements, typically of type T
. The
sequence is stored in different ways, depending on the actual container.
The object allocates and frees storage for the sequence it controls through a protected object named allocator
, of
class A
. Such an allocator object must have the same external interface as an object of template class allocator
.
Note that allocator
is not copied when the object is assigned. All constructors store an allocator argument (or, for
the copy constructor, x.
get_allocator
()
) in allocator
and initialize the controlled sequence.