std::count, std::count_if
Template:cpp/algorithm/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><algorithm>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >typename iterator_traits<InputIterator>::difference_type
<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">
<td >typename iterator_traits<InputIterator>::difference_type
<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end
Returns the number of elements in the range [first, last)
satisfying specific criteria. The first version counts the elements that are equal to value
, the second version counts elements for which predicate p
returns Template:cpp.
first, last | - | the range of elements to examine |
value | - | the value to search for |
p | - | unary predicate which returns true for the required elements. The expression p(v) must be convertible to bool for every argument |
Template:returns number of elements satisfying the condition.
linear in the distance between first
and last
This section is incomplete Reason: no eq fun |
This section is incomplete Reason: no example |