TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ insert_iterator()

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer, class BinaryType = std::vector<std::uint8_t>>
template<typename... Args>
iterator nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::insert_iterator ( const_iterator  pos,
Args &&...  args 
)
inline

Helper for insertion of an iterator.

Note
: This uses std::distance to support GCC 4.8, see https://github.com/nlohmann/json/pull/1257

Definition at line 23422 of file json.hpp.

23423 {
23424 iterator result(this);
23425 JSON_ASSERT(m_value.array != nullptr);
23426 auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
23427 m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...);
23428 result.m_it.array_iterator = m_value.array->begin() + insert_pos;
23429 // This could have been written as:
23430 // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
23431 // but the return value of insert is missing in GCC 4.8, so it is written this way instead.
23432 set_parents();
23433 return result;
23434 }
json_value m_value
the value of the current element
Definition: json.hpp:24928
iter_impl< basic_json > iterator
an iterator for a basic_json container
Definition: json.hpp:17991