Skip to content

Latest commit

 

History

History
54 lines (29 loc) · 1.15 KB

CppStdNot_equal_to.md

File metadata and controls

54 lines (29 loc) · 1.15 KB

 

 

 

 

 

 

Predicate to perform operator!= on two values.

 

 

 

 

 

Example

 

The code below shows how to count the number of non-zero values.

 


#include <algorithm> #include <vector> //From http://www.richelbilderbeek.nl/CppCountNonZeroes.htm int CountNonZeroes(const std::vector<double>& v) {  return std::count_if(     v.begin(),     v.end(),     std::bind2nd(std::not_equal_to<double>(),0.0)); }