[#BloombergLP-bdljsn-Json-insert-01] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/Json.adoc[Json]::insert :relfileprefix: ../../../ :mrdocs: Insert into the `JsonArray` held by this object at the specified `index` the values in the range `[first, last)]`, and return an iterator referring to the first newly inserted element. If `isNull()`, then the type is changed to array and `index` must be `0`. If an exception is thrown, `*this` is unaffected. Throw `bsl::length_error` if `size() + distance(first, last) > maxSize()`. The (template parameter) type `t_INDEX` must be a non‐`bool` integral type. The behavior is undefined unless `isArray()` or `isNull()`, and unless `index` is in the range `[0 .. size()]`. == Synopsis Declared in `<bdljsn_json.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_INDEX, class t_INPUT_ITERATOR> xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[JsonArray::Iterator] insert( t_INDEX index, t_INPUT_ITERATOR first, t_INPUT_ITERATOR last) requires bsl::is_integral<t_INDEX>::value && !bsl::is_same<t_INDEX, bool>::value; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#