| 3293 | /// see https://github.com/nlohmann/json/pull/1257 |
| 3294 | template<typename... Args> |
| 3295 | iterator insert_iterator(const_iterator pos, Args&& ... args) // NOLINT(performance-unnecessary-value-param) |
| 3296 | { |
| 3297 | iterator result(this); |
| 3298 | JSON_ASSERT(m_data.m_value.array != nullptr); |
| 3299 | |
| 3300 | auto insert_pos = std::distance(m_data.m_value.array->begin(), pos.m_it.array_iterator); |
| 3301 | m_data.m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...); |
| 3302 | result.m_it.array_iterator = m_data.m_value.array->begin() + insert_pos; |
| 3303 | |
| 3304 | // This could have been written as: |
| 3305 | // result.m_it.array_iterator = m_data.m_value.array->insert(pos.m_it.array_iterator, cnt, val); |
| 3306 | // but the return value of insert is missing in GCC 4.8, so it is written this way instead. |
| 3307 | |
| 3308 | set_parents(); |
| 3309 | return result; |
| 3310 | } |
| 3311 | |
| 3312 | /// @brief inserts element into array |
| 3313 | /// @sa https://json.nlohmann.me/api/basic_json/insert/ |
no test coverage detected