Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
object::insert (3 of 3 overloads)

Insert elements.

Synopsis
void
insert(
    std::initializer_list< std::pair< string_view, value_ref > > init);
Description

The elements in the initializer list 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 initializer list that are equal to each other, only the first will be inserted. Insertion may result in rehashing of the container. In that case all iterators and references are invalidated. Otherwise, they are not affected.

Complexity

Linear in init.size().

Exception Safety

Basic guarantee. Calls to memory_resource::allocate may throw.

Parameters

Name

Description

init

The initializer list to insert


PrevUpHomeNext