replace

Examines each element in a range and replaces it if it matches a specified value.

 
template<class ForwardIterator, class Type> 
   void replace( 
      ForwardIterator _First,  
      ForwardIterator _Last, 
      const Type& _OldVal,  
      const Type& _NewVal 
   );

 

replace_if

Examines each element in a range and replaces it if it satisfies a specified predicate.

template<class ForwardIterator, class Predicate, class Type> 
   void replace_if( 
      ForwardIterator _First,  
      ForwardIterator _Last, 
      Predicate _Pred,  
      const Type& _Val 
   );

 

replace_copy

Examines each element in a source range and replaces it if it matches a specified value while copying the result into a new destination range.

template<class InputIterator, class OutputIterator, class Type> 
   OutputIterator replace_copy( 
      InputIterator _First,  
      InputIterator _Last,  
      OutputIterator _Result, 
      const Type& _OldVal,  
      const Type& _NewVal 
   );

 

replace_copy_if

Examines each element in a source range and replaces it if it satisfies a specified predicate while copying the result into a new destination range.

template<class InputIterator, class OutputIterator, class Predicate, class Type> 
   OutputIterator replace_copy_if( 
      InputIterator _First,  
      InputIterator _Last,  
      OutputIterator _Result,  
      Predicate _Pred,  
      const Type& _Val 
   );

 

相关文章:

  • 2021-06-25
  • 2021-11-28
  • 2021-12-02
  • 2021-06-13
  • 2022-02-16
  • 2022-01-11
  • 2021-12-18
  • 2021-10-23
猜你喜欢
  • 2022-01-04
  • 2022-12-23
  • 2022-03-05
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
相关资源
相似解决方案