[#BloombergLP-bdlc-FlatHashSet-erase-05] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashSet.adoc[FlatHashSet]::erase :relfileprefix: ../../../ :mrdocs: `erase` overloads == Synopses Declared in `<bdlc_flathashset.h>` Remove from this set the element at the specified `position`, and return a `const_iterator` referring to the element immediately following the removed element, or to the past‐the‐end position if the removed element was the last element in the sequence of elements maintained by this set. This method invalidates all iterators and references to the removed element. The behavior is undefined unless `position` refers to an element in this set. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[FlatHashSet<KEY, HASH, EQUAL>::const_iterator] xref:BloombergLP/bdlc/FlatHashSet/erase-0d.adoc[erase](xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator] position); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/erase-0d.adoc[_» more..._]# Remove from this set the element whose key is equal to the specified `key`, if it exists, and return 1; otherwise (there is no element having `key` in this set), return 0 with no other effect. This method invalidates all iterators and references to the removed element. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::size_t xref:BloombergLP/bdlc/FlatHashSet/erase-01.adoc[erase](KEY const& key); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/erase-01.adoc[_» more..._]# Remove from this set the element whose key is equivalent to the specified `key`, if it exists, and return 1; otherwise (there is no element equivalent to `key` in this set), return 0 with no other effect. This method invalidates all iterators and references to the removed element. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> std::size_t xref:BloombergLP/bdlc/FlatHashSet/erase-04.adoc[erase](LOOKUP_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value; ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/erase-04.adoc[_» more..._]# Remove from this set the elements starting at the specified `first` position up to, but not including, the specified `last` position, and return `last`. This method invalidates all iterators and references to the removed elements. The behavior is undefined unless `first` and `last` are valid iterators on this set, and the `first` position is at or before the `last` position in the iteration sequence provided by this container. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[FlatHashSet<KEY, HASH, EQUAL>::const_iterator] xref:BloombergLP/bdlc/FlatHashSet/erase-0c.adoc[erase]( xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator] first, xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[const_iterator] last); ---- [.small]#xref:BloombergLP/bdlc/FlatHashSet/erase-0c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#