[#BloombergLP-bdlc-FlatHashSet-insert-0c] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashSet.adoc[FlatHashSet]::insert :relfileprefix: ../../../ :mrdocs: `insert` overloads == Synopses Declared in `<bdlc_flathashset.h>` Insert the specified `value` into this set if the `value` does not already exist in this set; otherwise, this method has no effect. Return a `pair` whose `first` member is a `const_iterator` referring to the (possibly newly inserted) element in this set whose value is equivalent to that of the element to be inserted, and whose `second` member is `true` if a new element was inserted, and `false` if an equivalent value was already present. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[bsl::pair<const_iterator, bool>] xref:BloombergLP/bdlc/FlatHashSet/insert-0ee.adoc[insert](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<KEY>] value); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-0ee.adoc[_» more..._]# Insert into this set an element having the value of each object in the specified `values` initializer list if an equivalent value is not already contained in this set. This method requires that the (template parameter) type `KEY` be copy‐insertable (see {Requirements on `KEY`, `HASH`, and `EQUAL`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bdlc/FlatHashSet/insert-00.adoc[insert](bsl::initializer_list<KEY> values); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-00.adoc[_» more..._]# Insert the specified `value` into this set if the `value` does not already exist in this set; otherwise, this method has no effect. Return a `pair` whose `first` member is a `const_iterator` referring to the (possibly newly inserted) element in this set whose value is equivalent to that of the element to be inserted, and whose `second` member is `true` if a new element was inserted, and `false` if an equivalent value was already present. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[bsl::pair<const_iterator, bool>] xref:BloombergLP/bdlc/FlatHashSet/insert-068.adoc[insert](KEY const& value); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-068.adoc[_» more..._]# Insert the specified `key` into this set if a key equivalent to `k` does not already exist in this set; otherwise, this method has no effect. Return a pair containing an `iterator` referring to the newly inserted element and `true` if a element was inserted. Return a pair containing an `iterator` to an existing element and `false` if the value already existed in the set. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> xref:bsl/pair-0b.adoc[bsl::pair<iterator, bool>] xref:BloombergLP/bdlc/FlatHashSet/insert-0e3.adoc[insert](LOOKUP_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value; ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-0e3.adoc[_» more..._]# Insert the specified `value` into this set if the `value` does not already exist in this set; otherwise, this method has no effect. Return a `const_iterator` referring to the (possibly newly inserted) element in this set whose value is equivalent to that of the element to be inserted. The supplied `const_iterator` is ignored. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator] xref:BloombergLP/bdlc/FlatHashSet/insert-06a.adoc[insert]( xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator], xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<KEY>] value); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-06a.adoc[_» more..._]# Insert the specified `value` into this set if the `value` does not already exist in this set; otherwise, this method has no effect. Return a `const_iterator` referring to the (possibly newly inserted) element in this set whose value is equivalent to that of the element to be inserted. The supplied `const_iterator` is ignored. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator] xref:BloombergLP/bdlc/FlatHashSet/insert-02.adoc[insert]( xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator], KEY const& value); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-02.adoc[_» more..._]# Insert into this set the value of each element in the input iterator range specified by `first` through `last` (including `first`, excluding `last`). 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`. Note that if a member of the input sequence is equivalent to an earlier member, the later member will not be inserted. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> void xref:BloombergLP/bdlc/FlatHashSet/insert-03.adoc[insert]( INPUT_ITERATOR first, INPUT_ITERATOR last); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-03.adoc[_» more..._]# Insert the specified `key` into this set if a key equivalent to `k` does not already exist in this set; otherwise, this method has no effect. Return a pair containing an `iterator` referring to the newly inserted element and `true` if a element was inserted. Return a pair containing an `iterator` to an existing element and `false` if the value already existed in the set. The supplied `const_iterator` is ignored. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> xref:BloombergLP/bdlc/FlatHashSet/iterator.adoc[iterator] xref:BloombergLP/bdlc/FlatHashSet/insert-08.adoc[insert]( xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator], LOOKUP_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value && bsl::is_convertible<LOOKUP_KEY&&, const_iterator>::value == false && bsl::is_convertible<const_iterator, LOOKUP_KEY&&>::value == false; ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/insert-08.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#