[#BloombergLP-bdljsn-JsonArray]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::JsonArray
:relfileprefix: ../../
:mrdocs:

This type is designed to replicate much of the standard sequence container interface, eliding interfaces that are less relevant for a non&hyphen;generic container&period; Note that a `bsl&colon;&colon;vector` is chosen for the implementation because our implementation permits the element type to be incomplete (when just spelling the type name)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class JsonArray;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdljsn/JsonArray/ConstIterator.adoc[`ConstIterator`] 
| This `typedef` is an alias for `ConstIterator`&period;
| xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[`Iterator`] 
| This `typedef` is an alias to `Elements&colon;&colon;iterator`&period;
| xref:BloombergLP/bdljsn/JsonArray/const_iterator.adoc[`const&lowbar;iterator`] 
| This `typedef` is an alias to `Elements&colon;&colon;const&lowbar;iterator`&period;
| xref:BloombergLP/bdljsn/JsonArray/const_reference.adoc[`const&lowbar;reference`] 
| This `typedef` is an alias for `const&lowbar;reference`&period;
| xref:BloombergLP/bdljsn/JsonArray/difference_type.adoc[`difference&lowbar;type`] 
| This `typedef` is an alias to `Elements&colon;&colon;difference&lowbar;type`&period;
| xref:BloombergLP/bdljsn/JsonArray/iterator-05.adoc[`iterator`] 
| This `typedef` is an alias to `Elements&colon;&colon;iterator`&period;
| xref:BloombergLP/bdljsn/JsonArray/reference.adoc[`reference`] 
| This `typedef` is an alias for `reference`&period;
| xref:BloombergLP/bdljsn/JsonArray/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to `Elements&colon;&colon;size&lowbar;type`&period;
| xref:BloombergLP/bdljsn/JsonArray/value_type.adoc[`value&lowbar;type`] 
| This `typedef` is an alias for `value&lowbar;type`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdljsn/JsonArray/2constructor-0e.adoc[`JsonArray`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdljsn/JsonArray/operator_assign-04.adoc[`operator&equals;`] 
| Assignment operators
| xref:BloombergLP/bdljsn/JsonArray/allocator.adoc[`allocator`] 
| Return the allocator used by this object to allocate memory&period;
| xref:BloombergLP/bdljsn/JsonArray/assign-02.adoc[`assign`] 
| `assign` overloads
| xref:BloombergLP/bdljsn/JsonArray/back-068.adoc[`back`] 
| `back` overloads
| xref:BloombergLP/bdljsn/JsonArray/begin-0e.adoc[`begin`] 
| `begin` overloads
| xref:BloombergLP/bdljsn/JsonArray/cbegin.adoc[`cbegin`] 
| Return an iterator providing non&hyphen;modifiable access to the first element in this `JsonArray`, and the past&hyphen;the&hyphen;end iterator if this `JsonArray` is empty&period;
| xref:BloombergLP/bdljsn/JsonArray/cend.adoc[`cend`] 
| Return the past&hyphen;the&hyphen;end iterator providing non&hyphen;modifiable access to this `JsonArray`&period;
| xref:BloombergLP/bdljsn/JsonArray/clear.adoc[`clear`] 
| Remove all elements from this `JsonArray` making its size 0&period; Note that although this `JsonArray` is empty after this method returns, it preserves the same capacity it had before the method was called&period;
| xref:BloombergLP/bdljsn/JsonArray/empty.adoc[`empty`] 
| Return `true` if this `JsonArray` has size 0, and `false` otherwise&period;
| xref:BloombergLP/bdljsn/JsonArray/end-01.adoc[`end`] 
| `end` overloads
| xref:BloombergLP/bdljsn/JsonArray/erase-0b.adoc[`erase`] 
| `erase` overloads
| xref:BloombergLP/bdljsn/JsonArray/front-01.adoc[`front`] 
| `front` overloads
| xref:BloombergLP/bdljsn/JsonArray/insert-0e4.adoc[`insert`] 
| `insert` overloads
| xref:BloombergLP/bdljsn/JsonArray/maxSize.adoc[`maxSize`] 
| Return a theoretical upper bound on the largest number of elements that this `JsonArray` could possibly hold&period; Requests to create a `JsonArray` longer than this number of elements are guaranteed to raise a `bsl&colon;&colon;length&lowbar;error` exception&period; Note that there is no guarantee that the `JsonArray` can successfully grow to the returned size, or even close to that size, without running out of resources&period;
| xref:BloombergLP/bdljsn/JsonArray/operator_subs-0b.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:BloombergLP/bdljsn/JsonArray/popBack.adoc[`popBack`] 
| Erase the last element from this `JsonArray`&period; The behavior is undefined if this `JsonArray` is empty&period;
| xref:BloombergLP/bdljsn/JsonArray/print.adoc[`print`] 
| Write the value of this object to the specified output `stream` in a human&hyphen;readable format, and return a reference to `stream`&period; Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects&period; If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period; Note that this human&hyphen;readable format is not fully specified, and can change without notice&period;
| xref:BloombergLP/bdljsn/JsonArray/pushBack-0b8.adoc[`pushBack`] 
| `pushBack` overloads
| xref:BloombergLP/bdljsn/JsonArray/resize-00.adoc[`resize`] 
| `resize` overloads
| xref:BloombergLP/bdljsn/JsonArray/size.adoc[`size`] 
| Return the number of elements in this `JsonArray`&period;
| xref:BloombergLP/bdljsn/JsonArray/swap.adoc[`swap`] 
| Exchange the value of this object with that of the specified `other` object&period; If an exception is thrown, both objects are left in valid but unspecified states&period; This operation guarantees O&lsqb;1&rsqb;complexity&period; The behavior is undefined unless this object was created with the same allocator as `other`&period;
| xref:BloombergLP/bdljsn/JsonArray/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;JsonArray, HasPrintMethod&gt;`] 
| Process the specified `array` during visitation of a `bdljsn&colon;&colon;Json` object&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdljsn/swap-02.adoc[BloombergLP::bdljsn::swap]`
| Exchange the value of the specified `a` `JsonArray` with that of the specified `b` `JsonArray`&period; This function provides the no&hyphen;throw exception&hyphen;safety guarantee&period; This operation has O&lsqb;1&rsqb;complexity if `a` was created with the same allocator as `b`&semi; otherwise, it has O&lsqb;n&plus;m&rsqb; complexity, where n and m are the number of elements in `a` and `b`, respectively&period;
| `xref:BloombergLP/bdljsn/operator_not_eq-01ca.adoc[BloombergLP::bdljsn::operator!&equals;]`
| Return `false` if the specified `lhs` and `rhs` objects have the same value, and `true` otherwise&period; Two `JsonArray` objects `lhs` and `rhs` have the same value if they have the same number of elements, and each element in the ordered sequence of elements of `lhs` has the same value as the corresponding element in the ordered sequence of elements of `rhs`&period;
| `xref:BloombergLP/bdljsn/operator_eq-061.adoc[BloombergLP::bdljsn::operator&equals;&equals;]`
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; Two `JsonArray` objects `lhs` and `rhs` have the same value if they have the same number of elements, and each element in the ordered sequence of elements of `lhs` has the same value as the corresponding element in the ordered sequence of elements of `rhs`&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdljsn/operator_not_eq-01d.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` arguments do not have the same value, and `false` otherwise&period; Two arguments do not have the same value if the `Json` object does not have the same value as a `Json` object constructed from the other argument&period;
| xref:BloombergLP/bdljsn/operator_eq-0dd1.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` arguments have the same value, and `false` otherwise&period; Two arguments have the same value if the `Json` object has the same value as a `Json` object constructed from the other argument&period;
|===


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