[#BloombergLP-bdljsn-JsonArray-assign-02] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray]::assign :relfileprefix: ../../../ :mrdocs: `assign` overloads == Synopses Declared in `<bdljsn_json.h>` Assign to this array a sequence of `Json` objects, one for each element (in order) of the specified `elements`. Previous elements of this array, if any, are destroyed. Return a reference to `*this`. If an exception is thrown, `*this` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray]& xref:BloombergLP/bdljsn/JsonArray/assign-01.adoc[assign](std::initializer_list<Json_Initializer> elements); ---- [.small]#xref:BloombergLP/bdljsn/JsonArray/assign-01.adoc[_» more..._]# 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. Return a non‐`const` reference to this array. If an exception is thrown, `*this` is left in a valid but unspecified state. Throw `bsl::length_error` if `distance(first,last) > maxSize()`. The (template parameter) type `t_INPUT_ITERATOR` shall meet the requirements of an input iterator defined in the c++11 standard [24.2.3]providing access to values of a type convertible to `Json`, and `Json` must be `emplace‐constructible` form `*i`, where `i` is a dereferenceable iterator in the range `[first .. last)]`. 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`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_INPUT_ITERATOR> xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray]& xref:BloombergLP/bdljsn/JsonArray/assign-03.adoc[assign]( t_INPUT_ITERATOR first, t_INPUT_ITERATOR last); ---- [.small]#xref:BloombergLP/bdljsn/JsonArray/assign-03.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#