Skip to content

Latest commit

 

History

History
55 lines (30 loc) · 1.01 KB

CppStdGreater_equal.md

File metadata and controls

55 lines (30 loc) · 1.01 KB

 

 

 

 

 

 

Predicate to perform operator>= on two values.

 

 

 

 

 

Example

 

The code below shows how to replace values that are greater or equal to one by a zero.

 


#include <vector> #include <algorithm #include <numeric>   void ReplaceOneOrHigherByZero(std::vector<int>& v) {   std::replace_if(v.begin(),v.end(),     std::bind2nd(std::greater_equal<int>(),1),0); }