explicit list(const A& al = A());
explicit list(size_type n, const T& v = T(), const A& al = A());
list(const list& x);
list(const_iterator first, const_iterator last, const A& al = A());
All constructors store the allocator object al
(or, for the copy constructor, x.
get_allocator
()
) in allocator
and
initialize the controlled sequence. The first constructor specifies an empty initial controlled sequence. The second
constructor specifies a repetition of n
elements of value x
. The third constructor specifies a copy of the sequence
controlled by x
. The last constructor specifies the sequence [first, last)
. None of the constructors perform any
interim reallocations.
In this implementation, if a translator does not support member template functions, the template:
template<class InIt>
list(InIt first, InIt last, const A& al = A());
is replaced by:
list(const_iterator first, const_iterator last,
const A& al = A());
See the related sample program.