...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Insert elements before the specified location.
array::iterator
insert(array::const_iterator
pos,value
const& v);
This inserts a copy of v
before pos
. If capacity()
< size() + 1
, 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.
Constant plus linear in 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 value to insert. A copy will be made using container's
associated |
An iterator to the inserted value