insert overloads

Synopses

Declared in <bslstl_map.h>

Insert a movable value if its key is absent.

Insert elements from values whose keys are not already present.

void
insert(std::initializer_list<value_type> values);

Insert a copy of value if its key is absent.

Insert an element constructed from value if its key is absent.

template<class ALT_VALUE_TYPE>
pair<iterator, bool>
insert(ALT_VALUE_TYPE&& value)
requires std::is_constructible<value_type,
                                             ALT_VALUE_TYPE&&>::value;

Insert a movable value near hint if its key is absent.

Insert a copy of value near hint if its key is absent.

Insert elements from [first, last)] whose keys are not already present.

template<class INPUT_ITERATOR>
void
insert(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last);

Insert a convertible value near hint if its key is absent.

template<class ALT_VALUE_TYPE>
iterator
insert(
    const_iterator hint,
    ALT_VALUE_TYPE&& value)
requires std::is_constructible<value_type,
                                             ALT_VALUE_TYPE&&>::value;

Return Value

  • pair of iterator and whether a new element was inserted

  • iterator to the existing or newly inserted element

Parameters

Name

Description

value

element to move‐insert

values

initializer list of elements to insert

hint

iterator hint for the insertion position

first

beginning of the range to insert

last

end of the range to insert

Created with MrDocs