Insert an entry for key if no equivalent key is already present.
Synopsis
Declared in <bdlc_flathashtable.h>
template<class LOOKUP_KEY>
bsl::pair<iterator, bool>
insertTransparent(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 table if a key equivalent to key does not already exist in this table; otherwise, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) object in this table whose key is the equal to that of the object to be inserted, and whose second member is true if a new entry was inserted, and false if a entry having an equal key was already present. Bitwise movable types that are not bitwise copyable will be copied (to avoid confusion with regard to calling the entry destructor after this call).
Return Value
pair of iterator to the entry and whether insertion occurred
Parameters
Name |
Description |
key |
key used to find or construct the entry |
Created with MrDocs