MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / insert_iterator

Function insert_iterator

dependencies/json/json.hpp:22067–22081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22065 /// see https://github.com/nlohmann/json/pull/1257
22066 template<typename... Args>
22067 iterator insert_iterator(const_iterator pos, Args&& ... args)
22068 {
22069 iterator result(this);
22070 JSON_ASSERT(m_value.array != nullptr);
22071
22072 auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
22073 m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...);
22074 result.m_it.array_iterator = m_value.array->begin() + insert_pos;
22075
22076 // This could have been written as:
22077 // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
22078 // but the return value of insert is missing in GCC 4.8, so it is written this way instead.
22079
22080 return result;
22081 }
22082
22083 /*!
22084 @brief inserts element

Callers 1

insertFunction · 0.70

Calls 2

beginMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected