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
   );
原文地址:https://www.cnblogs.com/freewater/p/2948299.html