MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / insert_iterator

Function insert_iterator

extern/json/json.hpp:22480–22495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22478 /// see https://github.com/nlohmann/json/pull/1257
22479 template<typename... Args>
22480 iterator insert_iterator(const_iterator pos, Args&& ... args)
22481 {
22482 iterator result(this);
22483 JSON_ASSERT(m_value.array != nullptr);
22484
22485 auto insert_pos = std::distance(m_value.array->begin(), pos.m_it.array_iterator);
22486 m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...);
22487 result.m_it.array_iterator = m_value.array->begin() + insert_pos;
22488
22489 // This could have been written as:
22490 // result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
22491 // but the return value of insert is missing in GCC 4.8, so it is written this way instead.
22492
22493 set_parents();
22494 return result;
22495 }
22496
22497 /// @brief inserts element into array
22498 /// @sa https://json.nlohmann.me/api/basic_json/insert/

Callers 1

insertFunction · 0.85

Calls 4

distanceFunction · 0.85
set_parentsFunction · 0.85
beginMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected