MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / insert

Method insert

include/jsoncons/json_object.hpp:559–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557
558 template <typename InputIt>
559 void insert(InputIt first, InputIt last)
560 {
561 for (auto it = first; it != last; ++it)
562 {
563 members_.emplace_back(key_type((*it).first.c_str(), (*it).first.size(), get_allocator()), (*it).second);
564 }
565 std::stable_sort(members_.begin(),members_.end(),
566 [](const key_value_type& a, const key_value_type& b) -> bool {return a.key().compare(b.key()) < 0;});
567 auto last2 = std::unique(members_.begin(), members_.end(),
568 [](const key_value_type& a, const key_value_type& b) -> bool { return !(a.key().compare(b.key()));});
569 members_.erase(last2, members_.end());
570 }
571
572 template <typename InputIt>
573 void insert(sorted_unique_range_tag, InputIt first, InputIt last)

Callers

nothing calls this directly

Calls 11

get_allocatorFunction · 0.85
findFunction · 0.85
convertFunction · 0.85
emplaceMethod · 0.80
c_strMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
compareMethod · 0.45
keyMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected