MCPcopy Create free account
hub / github.com/catboost/catboost / EraseNodesIf

Function EraseNodesIf

util/generic/algorithm.h:341–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339
340template <class C, class P>
341void EraseNodesIf(C& c, P p) {
342 for (auto iter = c.begin(), last = c.end(); iter != last;) {
343 if (p(*iter)) {
344 if constexpr (std::is_same_v<decltype(iter), decltype(c.erase(iter))>) {
345 iter = c.erase(iter);
346 } else {
347 c.erase(iter++);
348 }
349 } else {
350 ++iter;
351 }
352 }
353}
354
355template <class T1, class T2>
356constexpr bool Equal(T1 f1, T1 l1, T2 f2) {

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 4

pFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected