I\'ve got a container and would like to erase elements based on a predicate. erase_if sounds familiar, but I can\'t find it in C++. What\'s the name and where i
I'm guessing you're thinking of remove_if which takes a predicate to determine if the element ought to be removed.
remove_if returns an iterator pointing to the beginning of the elements to remove in the container. To actually remove them you need to use erase:
container.erase(remove_if(container.start(), container.end(), pred), container.end())
Either that or perhaps you mistakenly recalled the copy_if algorithm? Which somehow got left out of the standard but was written about - and implemented - in Effective STL.