MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / insert_iterator

Function insert_iterator

Source/Utils/json.hpp:21983–21997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21981 /// see https://github.com/nlohmann/json/pull/1257
21982 template<typename... Args>
21983 iterator insert_iterator(const_iterator pos, Args&& ... args)
21984 {
21985 iterator result(this);
21986 JSON_ASSERT(m_value.array != nullptr);
21987
21988 auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
21989 m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...);
21990 result.m_it.array_iterator = m_value.array->begin() + insert_pos;
21991
21992 // This could have been written as:
21993 // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
21994 // but the return value of insert is missing in GCC 4.8, so it is written this way instead.
21995
21996 return result;
21997 }
21998
21999 /*!
22000 @brief inserts element

Callers 1

insertFunction · 0.85

Calls 2

insertMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected