insert_or_assign overloads

Synopses

Declared in <bslstl_map.h>

Insert or assign using a movable key and obj.

Insert or assign using key and obj.

template<class BDE_OTHER_TYPE>
pair<map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
insert_or_assign(
    KEY const& key,
    BDE_OTHER_TYPE&& obj);

Insert or assign using a transparent key and obj.

template<
    class LOOKUP_KEY,
    class BDE_OTHER_TYPE>
pair<iterator, bool>
insert_or_assign(
    LOOKUP_KEY&& key,
    BDE_OTHER_TYPE&& obj)
requires BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
                                                   LOOKUP_KEY>::value;

Insert or assign near hint using a movable key.

Insert or assign near hint using key and obj.

template<class BDE_OTHER_TYPE>
map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
insert_or_assign(
    const_iterator hint,
    KEY const& key,
    BDE_OTHER_TYPE&& obj);

Insert or assign near hint using a transparent key.

template<
    class LOOKUP_KEY,
    class BDE_OTHER_TYPE>
iterator
insert_or_assign(
    const_iterator hint,
    LOOKUP_KEY&& key,
    BDE_OTHER_TYPE&& obj)
requires BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
                                                   LOOKUP_KEY>::value;

Return Value

  • pair of iterator and whether a new element was inserted

  • iterator to the existing or newly inserted element

Parameters

Name

Description

key

key to move into the element

obj

mapped value to assign or insert

hint

iterator hint for the insertion position

Created with MrDocs