I have a std::vector filled with objects. I want to filter and copy all the elements for which some predicate returns true in to a new std::v
std::vector
true
std::v
If you have C++11 then use std::copy_if as suggested in Eugen's answer. Otherwise, you can use std::remove_copy_if with appropriate modifications to your predicate's logic.
std::copy_if
you can use the std::copy_if method. See here.