| 22434 | /// see https://github.com/nlohmann/json/pull/1257 |
| 22435 | template<typename... Args> |
| 22436 | iterator insert_iterator(const_iterator pos, Args&& ... args) |
| 22437 | { |
| 22438 | iterator result(this); |
| 22439 | JSON_ASSERT(m_value.array != nullptr); |
| 22440 | |
| 22441 | auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator); |
| 22442 | m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...); |
| 22443 | result.m_it.array_iterator = m_value.array->begin() + insert_pos; |
| 22444 | |
| 22445 | // This could have been written as: |
| 22446 | // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val); |
| 22447 | // but the return value of insert is missing in GCC 4.8, so it is written this way instead. |
| 22448 | |
| 22449 | set_parents(); |
| 22450 | return result; |
| 22451 | } |
| 22452 | |
| 22453 | /// @brief inserts element into array |
| 22454 | /// @sa https://json.nlohmann.me/api/basic_json/insert/ |
no test coverage detected