| 22478 | /// see https://github.com/nlohmann/json/pull/1257 |
| 22479 | template<typename... Args> |
| 22480 | iterator insert_iterator(const_iterator pos, Args&& ... args) |
| 22481 | { |
| 22482 | iterator result(this); |
| 22483 | JSON_ASSERT(m_value.array != nullptr); |
| 22484 | |
| 22485 | auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator); |
| 22486 | m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...); |
| 22487 | result.m_it.array_iterator = m_value.array->begin() + insert_pos; |
| 22488 | |
| 22489 | // This could have been written as: |
| 22490 | // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val); |
| 22491 | // but the return value of insert is missing in GCC 4.8, so it is written this way instead. |
| 22492 | |
| 22493 | set_parents(); |
| 22494 | return result; |
| 22495 | } |
| 22496 | |
| 22497 | /// @brief inserts element into array |
| 22498 | /// @sa https://json.nlohmann.me/api/basic_json/insert/ |
no test coverage detected