[#bsl-unordered_map-02b-operator_subs-01] = xref:bsl.adoc[bsl]::xref:bsl/unordered_map-02b.adoc[unordered_map]::operator[] :relfileprefix: ../../ :mrdocs: Subscript operators == Synopses Declared in `<bslstl_unorderedmap.h>` 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) `VALUE` is "default‐constructible" (see {Requirements on `value_type`}). Note that `key` may be modified; it is guaranteed to be left in a valid state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- add_lvalue_reference<VALUE>::type xref:bsl/unordered_map-02b/operator_subs-0d4.adoc[operator[]](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<key_type>] key); ---- [.small]#xref:bsl/unordered_map-02b/operator_subs-0d4.adoc[_» more..._]# 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`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- add_lvalue_reference<VALUE>::type xref:bsl/unordered_map-02b/operator_subs-0de.adoc[operator[]](xref:bsl/unordered_map-02b/key_type.adoc[key_type] const& key); ---- [.small]#xref:bsl/unordered_map-02b/operator_subs-0de.adoc[_» more..._]# Return a reference providing modifiable access to the mapped‐value associated with a key that is equivalent with the specified `key`; if this `map` does not already contain a `value_type` object having an equivalent key, first insert a new `value_type` object having the move‐inserted `key` and a default‐constructed `VALUE` object, and return a reference to the newly mapped (default) value. This method requires that the (template parameter) type `KEY` be `move‐insertable` into this map and the (template parameter) type `VALUE` be `default‐insertable` into this map (see {Requirements on `KEY` and `VALUE`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class LOOKUP_KEY> add_lvalue_reference<VALUE>::type xref:bsl/unordered_map-02b/operator_subs-0a.adoc[operator[]](LOOKUP_KEY&& key) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value; ---- [.small]#xref:bsl/unordered_map-02b/operator_subs-0a.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#