insert overloads

Synopses

Declared in <bslstl_set.h>

Move‐insert value if an equivalent key is not already present.

Insert each unique value from the values initializer list.

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

Insert value if an equivalent key is not already present.

Insert a transparent value if an equivalent key is not present.

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

Move‐insert value near hint if an equivalent key is not present.

Insert value near hint if an equivalent key is not present.

Insert each unique value from the range [first .. last)].

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

Insert a transparent value near hint if not already present.

template<class LOOKUP_KEY>
iterator
insert(
    const_iterator hint,
    LOOKUP_KEY&& value)
requires BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
                                                   LOOKUP_KEY>::value
        && !bsl::is_convertible<LOOKUP_KEY&&, iterator>::value
        && !bsl::is_convertible<LOOKUP_KEY&&, const_iterator>::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

key to move‐insert

values

initializer list of keys to insert

hint

iterator hint for insertion position

first

beginning of the range (inclusive)

last

end of the range (exclusive)

Created with MrDocs