[#BloombergLP-bdljsn-Json-operator_subs-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/Json.adoc[Json]::operator&lsqb;&rsqb;
:relfileprefix: ../../../
:mrdocs:

Subscript operators

== Synopses

Declared in `&lt;bdljsn&lowbar;json&period;h&gt;`

Return a reference providing modifiable access to the element at the specified `index` in the `JsonArray` held by this object&period; The behavior is undefined unless `isArray()` returns true and `index &lt; theArray()&period;size()`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_subs-03.adoc[operator&lsqb;&rsqb;](std::size&lowbar;t index);
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_subs-03.adoc[_» more&period;&period;&period;_]#

Return a reference providing non&hyphen;modifiable access to the element at the specified `index` in the `JsonArray` held by this object&period; The behavior is undefined unless `isArray()` returns true and `index &lt; theArray()&period;size()`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json] const&
xref:BloombergLP/bdljsn/Json/operator_subs-04.adoc[operator&lsqb;&rsqb;](std::size&lowbar;t index) const;
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_subs-04.adoc[_» more&period;&period;&period;_]#

Return a reference providing modifiable access to the `Json` object associated with the specified `key` in the `JsonObject` held by this object&period; If `isNull()`, then type is changed to object&period; If the `JsonObject` does not already contain a `Json` object associated with `key`, first insert a new default&hyphen;constructed `Json` object associated with `key`&period; The behavior is undefined unless `isObject()` or `isNull()`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json]&
xref:BloombergLP/bdljsn/Json/operator_subs-07.adoc[operator&lsqb;&rsqb;](std::string&lowbar;view const& key);
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_subs-07.adoc[_» more&period;&period;&period;_]#

Return a reference providing non&hyphen;modifiable access to the `Json` object associated with the specified `key` in this `JsonObject`&period; The behavior is undefined unless `key` is valid UTF&hyphen;8 (see `bdlde&colon;&colon;Utf8Util&colon;&colon;isValid`) and this `JsonObject` already contains a `Json` object associated with `key`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/Json.adoc[Json] const&
xref:BloombergLP/bdljsn/Json/operator_subs-0b.adoc[operator&lsqb;&rsqb;](std::string&lowbar;view const& key) const;
----

[.small]#xref:BloombergLP/bdljsn/Json/operator_subs-0b.adoc[_» more&period;&period;&period;_]#


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