MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / erase

Function erase

examples/server/json.hpp:19042–19059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19040 }
19041
19042 size_type erase(const key_type& key)
19043 {
19044 for (auto it = this->begin(); it != this->end(); ++it)
19045 {
19046 if (m_compare(it->first, key))
19047 {
19048 // Since we cannot move const Keys, re-construct them in place
19049 for (auto next = it; ++next != this->end(); ++it)
19050 {
19051 it->~value_type(); // Destroy but keep allocation
19052 new (&*it) value_type{std::move(*next)};
19053 }
19054 Container::pop_back();
19055 return 1;
19056 }
19057 }
19058 return 0;
19059 }
19060
19061 template<class KeyType, detail::enable_if_t<
19062 detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value, int> = 0>

Callers 1

merge_patchFunction · 0.85

Calls 15

pop_backFunction · 0.85
resizeFunction · 0.85
createFunction · 0.85
is_stringFunction · 0.85
destroyFunction · 0.85
is_binaryFunction · 0.85
erase_internalFunction · 0.85
is_arrayFunction · 0.85
is_beginMethod · 0.80
is_endMethod · 0.80
beginFunction · 0.70
endFunction · 0.70

Tested by

no test coverage detected