Return a modifiable reference to the mapped value for key.

Synopsis

Declared in <bslstl_unorderedmap.h>

add_lvalue_reference<VALUE>::type
operator[](key_type const& key);

Description

Return a reference providing modifiable access to the mapped‐value associated with the specified key in this unordered map; if this unordered map does not already contain a value_type object with key, first insert a new value_type object having key and a default‐constructed VALUE object. Note that this method requires that the (template parameter) type KEY is copy‐constructible and the (template parameter) VALUE is "default‐constructible" (see {Requirements on value_type}).

Return Value

modifiable reference to the mapped value

Parameters

Name

Description

key

key to look up

Created with MrDocs