I l@ve RuBoard Previous Section Next Section

count_if()

Returns a count of the number of times the operator evaluated as true.



#include <algorithm> 


class Even { 


public: 


   bool operator()( int val ){ return !( val%2 ); } 


}; 





ires = count_if( ia, ia+8, bind2nd(less<int>(),10) ); 


lres = count_if( ilist.begin(), ilist_end(), Even() ); 
    I l@ve RuBoard Previous Section Next Section