BloombergLP::bdlc::FlatHashSet::insert

Insert the specified key into this set if not already present.

Synopsis

Declared in <bdlc_flathashset.h>

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

Description

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.

Return Value

pair of iterator to the element and whether insertion occurred

Parameters

NameDescription
keykey to insert