MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / removeIf

Function removeIf

Libraries/Containers/Algorithms/AlgorithmRemove.h:22–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20/// @return `last`
21template <typename ForwardIterator, typename UnaryPredicate>
22ForwardIterator removeIf(ForwardIterator first, ForwardIterator last, UnaryPredicate&& predicate)
23{
24 auto found = findIf(first, last, forward<UnaryPredicate>(predicate));
25 if (found != last)
26 {
27 auto it = found;
28 while (++it != last)
29 {
30 if (not predicate(*it))
31 {
32 *found++ = move(*it);
33 }
34 }
35 }
36 return found;
37}
38
39//! @}
40

Callers 2

removeAllFunction · 0.85
removeAllMethod · 0.85

Calls 1

findIfFunction · 0.85

Tested by

no test coverage detected