MCPcopy Create free account
hub / github.com/comaps/comaps / ForEachByKey

Method ForEachByKey

generator/intermediate_data.hpp:81–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80 template <typename ToDo>
81 void ForEachByKey(Key k, ToDo && toDo) const
82 {
83 auto range = std::equal_range(m_elements.begin(), m_elements.end(), k, ElementComparator());
84 for (; range.first != range.second; ++range.first)
85 if (toDo((*range.first).second) == base::ControlFlow::Break)
86 break;
87 }
88
89private:
90 using Element = std::pair<Key, Value>;

Calls 4

equal_rangeFunction · 0.85
ElementComparatorClass · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected