| 3000 | /// see https://github.com/nlohmann/json/pull/1257 |
| 3001 | template<typename... Args> |
| 3002 | iterator insert_iterator(const_iterator pos, Args&& ... args) |
| 3003 | { |
| 3004 | iterator result(this); |
| 3005 | JSON_ASSERT(m_value.array != nullptr); |
| 3006 | |
| 3007 | auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator); |
| 3008 | m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...); |
| 3009 | result.m_it.array_iterator = m_value.array->begin() + insert_pos; |
| 3010 | |
| 3011 | // This could have been written as: |
| 3012 | // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val); |
| 3013 | // but the return value of insert is missing in GCC 4.8, so it is written this way instead. |
| 3014 | |
| 3015 | set_parents(); |
| 3016 | return result; |
| 3017 | } |
| 3018 | |
| 3019 | /// @brief inserts element into array |
| 3020 | /// @sa https://json.nlohmann.me/api/basic_json/insert/ |
no test coverage detected