![]() |
Home | Libraries | People | FAQ | More |
Insert elements before the specified location.
array::iterator
insert(array::const_iterator
pos,std::size_t
count,value
const& v);
This inserts count
copies
of v
before pos
. If capacity() < size() + count
,
a reallocation occurs first, and all iterators and references are invalidated.
Otherwise, only the iterators and references from the insertion point
forward are invalidated. All past-the-end iterators are also invalidated.
Linear in count +
std::distance(pos, end())
.
Strong guarantee. Calls to memory_resource::allocate
may throw.
Name |
Description |
---|---|
|
Iterator before which the content will be inserted. This may
be the |
|
The number of copies to insert. |
|
The value to insert. Copies will be made using the container's
associated |
An iterator to the first inserted value, or pos
if count ==
0
.