mirror of
https://github.com/boostorg/range.git
synced 2025-07-29 20:37:25 +02:00
Boost.RangeEx merged into Boost.Range
[SVN r60897]
This commit is contained in:
36
doc/reference/algorithm/count.qbk
Normal file
36
doc/reference/algorithm/count.qbk
Normal file
@ -0,0 +1,36 @@
|
||||
[section:count count]
|
||||
|
||||
[heading 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);
|
||||
``
|
||||
|
||||
[heading Description]
|
||||
|
||||
`count` returns the number of elements `x` in `rng` where `x == val` is `true`.
|
||||
|
||||
[heading Definition]
|
||||
|
||||
Defined in the header file `boost/range/algorithm/count.hpp`
|
||||
|
||||
[heading Requirements]
|
||||
|
||||
* `SinglePassRange` is a model of the __single_pass_range__ Concept.
|
||||
* `Value` is a model of the `EqualityComparableConcept`.
|
||||
* `SinglePassRange`'s value type is a model of the `EqualityComparableConcept`.
|
||||
* An object of `SinglePassRange`'s value type can be compared for equality with an object of type `Value`.
|
||||
|
||||
[heading Complexity]
|
||||
|
||||
Linear. Exactly `distance(rng)` comparisons.
|
||||
|
||||
[endsect]
|
||||
|
||||
|
Reference in New Issue
Block a user