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

Assign to this object the value resulting from first clearing this `JsonArray` and then inserting (in order) each `Json` object in the range starting at the specified `first` element, and ending immediately before the specified `last` element&period; Return a non&hyphen;`const` reference to this array&period; If an exception is thrown, `&ast;this` is left in a valid but unspecified state&period; Throw `bsl&colon;&colon;length&lowbar;error` if `distance(first,last) &gt; maxSize()`&period; The (template parameter) type `t&lowbar;INPUT&lowbar;ITERATOR` shall meet the requirements of an input iterator defined in the c&plus;&plus;11 standard &lsqb;24&period;2&period;3&rsqb;providing access to values of a type convertible to `Json`, and `Json` must be `emplace&hyphen;constructible` form `&ast;i`, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;`&period; The behavior is undefined unless `first` and `last` refer to a range of valid values where `first` is at a position at or before `last`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray]&
assign(
    t&lowbar;INPUT&lowbar;ITERATOR first,
    t&lowbar;INPUT&lowbar;ITERATOR last);
----


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