MCPcopy Create free account
hub / github.com/LAStools/LAStools / insert_iterator

Function insert_iterator

src/json.hpp:22572–22587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22570 /// see https://github.com/nlohmann/json/pull/1257
22571 template<typename... Args>
22572 iterator insert_iterator(const_iterator pos, Args&& ... args)
22573 {
22574 iterator result(this);
22575 JSON_ASSERT(m_data.m_value.array != nullptr);
22576
22577 auto insert_pos = std::distance(m_data.m_value.array->begin(), pos.m_it.array_iterator);
22578 m_data.m_value.array->insert(pos.m_it.array_iterator, std::forward<Args>(args)...);
22579 result.m_it.array_iterator = m_data.m_value.array->begin() + insert_pos;
22580
22581 // This could have been written as:
22582 // result.m_it.array_iterator = m_data.m_value.array->insert(pos.m_it.array_iterator, cnt, val);
22583 // but the return value of insert is missing in GCC 4.8, so it is written this way instead.
22584
22585 set_parents();
22586 return result;
22587 }
22588
22589 /// @brief inserts element into array
22590 /// @sa https://json.nlohmann.me/api/basic_json/insert/

Callers 1

insertFunction · 0.85

Calls 3

set_parentsFunction · 0.85
beginMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected