![]() |
TerraForge3D
2.3.1
3D Terrain And Landscape Generator
|
|
inline |
construct a JSON container given an iterator range
Constructs the JSON value with the contents of the range [first, last)
. The semantics depends on the different types a JSON value can have:
begin()
and last must be end()
. In this case, the value is copied. Otherwise, invalid_iterator.204 is thrown.std::vector
or std::map
; that is, a JSON array or object is constructed from the values in the range.InputIT | an input iterator type (iterator or const_iterator) |
[in] | first | begin of the range to copy from (included) |
[in] | last | end of the range to copy from (excluded) |
[first, last)
is valid. Usually, this precondition cannot be checked efficiently. Only certain edge cases are detected; see the description of the exceptions below. A violation of this precondition yields undefined behavior.std::abort
if this precondition is not met. Assertions can be disabled by defining NDEBUG
at compile time. See https://en.cppreference.com/w/cpp/error/assert for more information.invalid_iterator.201 | if iterators first and last are not compatible (i.e., do not belong to the same JSON value). In this case, the range [first, last) is undefined. |
invalid_iterator.204 | if iterators first and last belong to a primitive type (number, boolean, or string), but first does not point to the first element any more. In this case, the range [first, last) is undefined. See example code below. |
invalid_iterator.206 | if iterators first and last belong to a null value. In this case, the range [first, last) is undefined. |
@complexity Linear in distance between first and last.
@exceptionsafety Strong guarantee: if an exception is thrown, there are no changes to any JSON value.
@liveexample{The example below shows several ways to create JSON values by specifying a subrange with iterators.,basic_json__InputIt_InputIt}
Definition at line 19755 of file json.hpp.