bsl::map::try_emplace

Try to emplace an element with a movable key.

Synopsis

Declared in <bslstl_map.h>

template<class... Args>
pair<map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
try_emplace(
    BloombergLP::bslmf::MovableRef<KEY> key,
    Args&&... args);

Description

Same as the preceding try_emplace overload, for movable keys.

Return Value

pair of iterator and whether a new element was inserted

Parameters

NameDescription
keykey to move into the new element
argsconstructor arguments for the mapped value