STL: count

count

Returns the number of elements in a range whose values match a specified value.

template<class InputIterator, class Type>
   typename iterator_traits<InputIterator>::difference_type count(
      InputIterator _First, 
      InputIterator _Last, 
      const Type& _Val
   );

 

count_if

Returns the number of elements in a range whose values satisfy a specified condition.

template<class InputIterator, class Predicate>
   typename iterator_traits<InputIterator>::difference_type count_if(
      InputIterator _First, 
      InputIterator _Last,
      Predicate _Pred
   );

 

posted @ 2013-03-07 16:23  freewater  阅读(225)  评论(0编辑  收藏  举报