MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / insert_iterator

Function insert_iterator

external/json/json.hpp:17236–17250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17234 /// see https://github.com/nlohmann/json/pull/1257
17235 template<typename... Args>
17236 iterator insert_iterator(const_iterator pos, Args&& ... args)
17237 {
17238 iterator result(this);
17239 assert(m_value.array != nullptr);
17240
17241 auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
17242 m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...);
17243 result.m_it.array_iterator = m_value.array->begin() + insert_pos;
17244
17245 // This could have been written as:
17246 // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
17247 // but the return value of insert is missing in GCC 4.8, so it is written this way instead.
17248
17249 return result;
17250 }
17251
17252 /*!
17253 @brief inserts element

Callers 1

insertFunction · 0.85

Calls 3

distanceFunction · 0.50
beginMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected