User Tools

Site Tools


copy_if

copy_if

template<Class InputIterator, class OutputIterator, class Predicate>
OutputIterator copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred)
{
   for( ; first != last; first++)
   {
      if(pred(*first))
         *result++ = *first;
   }
   return result;
}
copy_if.txt · Last modified: 2016/05/14 11:04 (external edit)