...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.
template< class InputIt> void insert( InputIt first, InputIt last);
The elements in the range {first, last)
whose keys are unique are inserted one at a time, in order. If there
are elements with duplicate keys; that is, if multiple elements in the
range have keys that compare equal, only the first equivalent element
will be inserted.
first
and last
are not iterators into *this
.
std::is_constructible_v<value_type, std::iterator_traits<InputIt>::value_type>
Linear in std::distance(first, last)
.
Strong 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. |