[#bsl-unordered_set-02a-insert-097] = xref:bsl.adoc[bsl]::xref:bsl/unordered_set-02a.adoc[unordered_set<ManagedAttribute, AttributeHash>]::insert :relfileprefix: ../../ :mrdocs: `insert` overloads == Synopses Declared in `<bslstl_unorderedset.h>` Insert the specified `value` into this set if a key equivalent to `value` does not already exist in this set; otherwise, if a key equivalent to `value` already exists in this set, this method has no effect. `value` is left in a valid but unspecified state. Return a pair whose `first` member is an iterator referring to the (possibly newly inserted) `value_type` object in this set that is equivalent to `value`, and whose `second` member is `true` if a new value was inserted, and `false` if the key was already present. This method requires that the (template parameter) type `KEY` be `move‐insertable` into this set (see {Requirements on `KEY`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[pair<iterator, bool>] xref:bsl/unordered_set-02a/insert-01.adoc[insert](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<value_type>] value); ---- [.small]#xref:bsl/unordered_set-02a/insert-01.adoc[_» more..._]# Insert into this set the value of each `value_type` object in the specified `values` initializer list if a key equivalent to the object is not already contained in this set. This method requires that the (template parameter) type `KEY` be `copy‐insertable` (see {Requirements on `KEY`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/unordered_set-02a/insert-0b.adoc[insert](std::initializer_list<ManagedAttribute> values); ---- [.small]#xref:bsl/unordered_set-02a/insert-0b.adoc[_» more..._]# Insert the specified `value` into this set if a key equivalent to `value` does not already exist in this set; otherwise, if a key equivalent to `value` already exists in this set, this method has no effect. Return a pair whose `first` member is an iterator referring to the (possibly newly inserted) `value_type` object in this set that is equivalent to `value`, and whose `second` member is `true` if a new value was inserted, and `false` if the key was already present. This method requires that the (template parameter) type `KEY` be `copy‐insertable` (see {Requirements on `KEY`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[pair<iterator, bool>] xref:bsl/unordered_set-02a/insert-06.adoc[insert](xref:bsl/unordered_set-02a/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/unordered_set-02a/insert-06.adoc[_» more..._]# Insert the specified `value` into this set if a key equivalent to `value` does not already exist in this set; otherwise, if a key equivalent to `value` already exists in this set, this method has no effect. `value` is left in a valid but unspecified state. Return a pair whose `first` member is an iterator referring to the (possibly newly inserted) `value_type` object in this set that is equivalent to `value`, and whose `second` member is `true` if a new value was inserted, and `false` if the key was already present. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> xref:bsl/pair-0b.adoc[pair<iterator, bool>] xref:bsl/unordered_set-02a/insert-099.adoc[insert](LOOKUP_KEY&& value) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value; ---- [.small]#xref:bsl/unordered_set-02a/insert-099.adoc[_» more..._]# Insert the specified `value` into this set if a key equivalent to `value` does not already exist in this set; otherwise, if a key equivalent to `value` already exists in this set, this method has no effect. `value` is left in a valid but unspecified state. Return an iterator referring to the (possibly newly inserted) `value_type` object in this set that is equivalent to `value`. The average and worst case complexity of this operation is not affected by the specified `hint`. This method requires that the (template parameter) type `KEY` be `move‐insertable` (see {Requirements on `KEY`}) into this set. The behavior is undefined unless `hint` is an iterator in the range `[begin() .. end()]` (both endpoints included). Note that `hint` is ignored (other than possibly asserting its validity in some build modes). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-02a/iterator.adoc[iterator] xref:bsl/unordered_set-02a/insert-00.adoc[insert]( xref:bsl/unordered_set-02a/const_iterator.adoc[const_iterator] hint, xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<value_type>] value); ---- [.small]#xref:bsl/unordered_set-02a/insert-00.adoc[_» more..._]# Insert the specified `value` into this set if a key equivalent to `value` does not already exist in this set; otherwise, if a key equivalent to `value` already exists in this set, this method has no effect. Return an iterator referring to the (possibly newly inserted) `value_type` object in this set that is equivalent to `value`. The average and worst case complexity of this operation is not affected by the specified `hint`. This method requires that the (template parameter) type `KEY` be `copy‐constructible` into this set (see {Requirements on `KEY`}). The behavior is undefined unless `hint` is an iterator in the range `[begin() .. end()]` (both endpoints included). Note that `hint` is ignored (other than possibly asserting its validity in some build modes). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_set-02a/iterator.adoc[iterator] xref:bsl/unordered_set-02a/insert-0f.adoc[insert]( xref:bsl/unordered_set-02a/const_iterator.adoc[const_iterator] hint, xref:bsl/unordered_set-02a/value_type.adoc[value_type] const& value); ---- [.small]#xref:bsl/unordered_set-02a/insert-0f.adoc[_» more..._]# Insert into this set the value of each `value_type` object in the range starting at the specified `first` iterator and ending immediately before the specified `last` iterator, if a key equivalent to the object is not already contained in this set. The (template parameter) type `INPUT_ITERATOR` shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3]providing access to values of a type convertible to `value_type`, and `value_type` must be `emplace‐constructible` from `*i` into this set, where `i` is a dereferenceable iterator in the range `[first .. last)]` (see {Requirements on `KEY`}). The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> void xref:bsl/unordered_set-02a/insert-04.adoc[insert]( INPUT_ITERATOR first, INPUT_ITERATOR last); ---- [.small]#xref:bsl/unordered_set-02a/insert-04.adoc[_» more..._]# Insert the specified `value` into this set if a key equivalent to `value` does not already exist in this set; otherwise, if a key equivalent to `value` already exists in this set, this method has no effect. `value` is left in a valid but unspecified state. Return an iterator referring to the (possibly newly inserted) `value_type` object in this set that is equivalent to `value`. The average and worst case complexity of this operation is not affected by the specified `hint`. This method requires that the (template parameter) type `KEY` be `move‐insertable` (see {Requirements on `KEY`}) into this set. The behavior is undefined unless `hint` is an iterator in the range `[begin() .. end()]` (both endpoints included). Note that `hint` is ignored (other than possibly asserting its validity in some build modes). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> xref:bsl/unordered_set-02a/iterator.adoc[iterator] xref:bsl/unordered_set-02a/insert-0c.adoc[insert]( xref:bsl/unordered_set-02a/const_iterator.adoc[const_iterator], 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; ---- [.small]#xref:bsl/unordered_set-02a/insert-0c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#