MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / insert_iterator

Function insert_iterator

native/thirdpart/json/json.hpp:19679–19693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19677 /// see https://github.com/nlohmann/json/pull/1257
19678 template<typename... Args>
19679 iterator insert_iterator(const_iterator pos, Args&& ... args)
19680 {
19681 iterator result(this);
19682 assert(m_value.array != nullptr);
19683
19684 auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
19685 m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...);
19686 result.m_it.array_iterator = m_value.array->begin() + insert_pos;
19687
19688 // This could have been written as:
19689 // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
19690 // but the return value of insert is missing in GCC 4.8, so it is written this way instead.
19691
19692 return result;
19693 }
19694
19695 /*!
19696 @brief inserts element

Callers 1

insertFunction · 0.85

Calls 1

beginMethod · 0.45

Tested by

no test coverage detected