If for instance you have a std::vector<MyClass>, where MyClass has a public method: bool isTiredOfLife(), how do you remove the elements that return true?
If for instance you have a std::vector<MyClass> , where MyClass has a public method:
Share
I prefer remove_if
remove_ifreturns an iterator pointing after the last element that’s still in the sequence.eraseerases everything from its first to its last argument (both iterators).