template < class ForwardIterator, class T >
  ForwardIterator remove ( ForwardIterator first, ForwardIterator last,
                           const T& value ); <algorithm> 

Remove value from range

Removes from the range [first,last) the elements with a value equal to value and returns an iterator to the new end of the range, which now includes only the values not equal to value.

The behavior of this function template is equivalent to:
template < class ForwardIterator, class T >
  ForwardIterator remove ( ForwardIterator first, ForwardIterator last, const T& value )
{
  ForwardIterator result = first;
  for ( ; first != last; ++first)
    if (!(*first == value)) *result++ = *first;
  return result;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2021-05-06
  • 2021-06-23
  • 2021-10-24
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案