[#bsl-unordered_map-0bf-operator_subs-0a]
= xref:bsl.adoc[bsl]::xref:bsl/unordered_map-0bf.adoc[unordered&lowbar;map&lt;basic&lowbar;string&lt;char&gt;, Json, TransparentHash, TransparentEqualTo&gt;]::operator&lsqb;&rsqb;
:relfileprefix: ../../
:mrdocs:

Subscript operators

== Synopses

Declared in `&lt;bslstl&lowbar;unorderedmap&period;h&gt;`

Return a reference providing modifiable access to the mapped&hyphen;value associated with the specified `key` in this unordered map&semi; if this unordered map does not already contain a `value&lowbar;type` object with `key`, first insert a new `value&lowbar;type` object having `key` and a default&hyphen;constructed `VALUE` object&period; Note that this method requires that the (template parameter) `VALUE` is &quot;default&hyphen;constructible&quot; (see &lcub;Requirements on `value&lowbar;type`&rcub;)&period; Note that `key` may be modified&semi; it is guaranteed to be left in a valid state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/add_lvalue_reference-040/type.adoc[add&lowbar;lvalue&lowbar;reference&lt;Json&gt;::type]
xref:bsl/unordered_map-0bf/operator_subs-0f.adoc[operator&lsqb;&rsqb;](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;key&lowbar;type&gt;] key);
----

[.small]#xref:bsl/unordered_map-0bf/operator_subs-0f.adoc[_» more&period;&period;&period;_]#

Return a reference providing modifiable access to the mapped&hyphen;value associated with the specified `key` in this unordered map&semi; if this unordered map does not already contain a `value&lowbar;type` object with `key`, first insert a new `value&lowbar;type` object having `key` and a default&hyphen;constructed `VALUE` object&period; Note that this method requires that the (template parameter) type `KEY` is `copy&hyphen;constructible` and the (template parameter) `VALUE` is &quot;default&hyphen;constructible&quot; (see &lcub;Requirements on `value&lowbar;type`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/add_lvalue_reference-040/type.adoc[add&lowbar;lvalue&lowbar;reference&lt;Json&gt;::type]
xref:bsl/unordered_map-0bf/operator_subs-02.adoc[operator&lsqb;&rsqb;](xref:bsl/unordered_map-0bf/key_type.adoc[key&lowbar;type] const& key);
----

[.small]#xref:bsl/unordered_map-0bf/operator_subs-02.adoc[_» more&period;&period;&period;_]#

Return a reference providing modifiable access to the mapped&hyphen;value associated with a key that is equivalent with the specified `key`&semi; if this `map` does not already contain a `value&lowbar;type` object having an equivalent key, first insert a new `value&lowbar;type` object having the move&hyphen;inserted `key` and a default&hyphen;constructed `VALUE` object, and return a reference to the newly mapped (default) value&period; This method requires that the (template parameter) type `KEY` be `move&hyphen;insertable` into this map and the (template parameter) type `VALUE` be `default&hyphen;insertable` into this map (see &lcub;Requirements on `KEY` and `VALUE`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:bsl/add_lvalue_reference-040/type.adoc[add&lowbar;lvalue&lowbar;reference&lt;Json&gt;::type]
xref:bsl/unordered_map-0bf/operator_subs-05.adoc[operator&lsqb;&rsqb;](LOOKUP&lowbar;KEY&& key)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
        &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

[.small]#xref:bsl/unordered_map-0bf/operator_subs-05.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
