insert_or_assign overloads
Synopses
Declared in <bdlc_flathashmap.h>
Insert or assign the mapped value for the specified key.
template<class M>
bsl::pair<FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator, bool>
insert_or_assign(
BloombergLP::bslmf::MovableRef<KEY> key,
M&& obj);
Insert or assign the mapped value for the specified key.
template<class M>
bsl::pair<FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator, bool>
insert_or_assign(
KEY const& key,
M&& obj);
Insert or assign the mapped value for the specified key.
template<
class LOOKUP_KEY,
class M>
bsl::pair<iterator, bool>
insert_or_assign(
LOOKUP_KEY&& key,
M&& obj)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
&& BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value;
Insert or assign the mapped value for key using a hint.
template<class MAPPED>
FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
insert_or_assign(
const_iterator hint,
BloombergLP::bslmf::MovableRef<KEY> key,
MAPPED&& obj);
Insert or assign the mapped value for key using a hint.
template<class MAPPED>
FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
insert_or_assign(
const_iterator hint,
KEY const& key,
MAPPED&& obj);
Insert or assign the mapped value for key using a hint.
template<
class LOOKUP_KEY,
class MAPPED>
iterator
insert_or_assign(
const_iterator hint,
LOOKUP_KEY&& key,
MAPPED&& obj)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
&& BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value;
Return Value
-
pair of iterator to the element and
trueif inserted -
iterator to the inserted or updated element
Parameters
Name |
Description |
key |
key to insert or update (may be moved from) |
obj |
mapped value to assign or move‐insert |
hint |
iterator hint (ignored) |
Created with MrDocs