![]() |
Home | Libraries | People | FAQ | More |
Insert elements.
template< class InputIt> void insert( InputIt first, InputIt last);
The elements in the range [first, last)
are inserted one at a time, in order. Any element with key that is a
duplicate of a key already present in container will be skipped. This
also means, that if there are two keys within the range that are equal
to each other, only the first will be inserted. If the size necessary
to accomodate elements from the range exceeds capacity()
,
a rehashing can occur. In that case all iterators and references are
invalidated. Otherwise, they are not affected.
first
and last
are not iterators into *this
.
first
and last
form a valid range.
std::is_constructible_v<value_type, std::iterator_traits<InputIt>::value_type>
Linear in std::distance(first, last)
.
Basic guarantee. Calls to memory_resource::allocate
may throw.
Name |
Description |
---|---|
|
An input iterator pointing to the first element to insert, or pointing to the end of the range. |
|
An input iterator pointing to the end of the range. |
Type |
Description |
---|---|
|
a type satisfying the requirements of InputIterator. |