Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
count
Prototype

template<class SinglePassRange, class Value>
typename range_difference<SinglePassRange>::type
count(SinglePassRange& rng, const Value& val);

template<class SinglePassRange, class Value>
typename range_difference<const SinglePassRange>::type
count(const SinglePassRange& rng, const Value& val);

Description

count returns the number of elements x in rng where x == val is true.

Definition

Defined in the header file boost/range/algorithm/count.hpp

Requirements
Complexity

Linear. Exactly distance(rng) comparisons.


PrevUpHomeNext