bsl::unordered_set::insert

insert overloads

Synopses

Declared in <bslstl_unorderedset.h>

Insert value if its key is missing.

bsl::pair<unordered_set<KEY, HASH, EQUAL, ALLOCATOR>::iterator, bool>
insert(BloombergLP::bslmf::MovableRef<value_type> value);
» more...

Insert each value from values if its key is missing.

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

Insert value if its key is missing.

bsl::pair<unordered_set<KEY, HASH, EQUAL, ALLOCATOR>::iterator, bool>
insert(value_type const& value);
» more...

Insert value if its key is missing.

template<class LOOKUP_KEY>
pair<iterator, bool>
insert(LOOKUP_KEY&& value)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
        && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value;
» more...

Insert value using hint if its key is missing.

unordered_set<KEY, HASH, EQUAL, ALLOCATOR>::iterator
insert(
    const_iterator hint,
    BloombergLP::bslmf::MovableRef<value_type> value);
» more...

Insert value using hint if its key is missing.

unordered_set<KEY, HASH, EQUAL, ALLOCATOR>::iterator
insert(
    const_iterator hint,
    value_type const& value);
» more...

Insert value if its key is missing.

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

Insert value using hint if its key is missing.

template<class LOOKUP_KEY>
iterator
insert(
    const_iterator hint,
    LOOKUP_KEY&& value)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
        && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
        && !bsl::is_convertible<LOOKUP_KEY&&, iterator>::value
        && !bsl::is_convertible<LOOKUP_KEY&&, const_iterator>::value;
» more...

Return Value

  • iterator to the element and whether insertion occurred
  • iterator to the existing or newly inserted element

Parameters

NameDescription
valuevalue to insert
valuesinitializer list of values
hintposition hint for insertion
firstbeginning of the range of values to insert
lastend of the range of values to insert (one past last)