]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/range/doc/reference/algorithm/count.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / range / doc / reference / algorithm / count.qbk
1 [/
2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 /]
6 [section:count count]
7
8 [heading Prototype]
9
10 ``
11 template<class SinglePassRange, class Value>
12 typename range_difference<SinglePassRange>::type
13 count(SinglePassRange& rng, const Value& val);
14
15 template<class SinglePassRange, class Value>
16 typename range_difference<const SinglePassRange>::type
17 count(const SinglePassRange& rng, const Value& val);
18 ``
19
20 [heading Description]
21
22 `count` returns the number of elements `x` in `rng` where `x == val` is `true`.
23
24 [heading Definition]
25
26 Defined in the header file `boost/range/algorithm/count.hpp`
27
28 [heading Requirements]
29
30 * `SinglePassRange` is a model of the __single_pass_range__ Concept.
31 * `Value` is a model of the `EqualityComparableConcept`.
32 * `SinglePassRange`'s value type is a model of the `EqualityComparableConcept`.
33 * An object of `SinglePassRange`'s value type can be compared for equality with an object of type `Value`.
34
35 [heading Complexity]
36
37 Linear. Exactly `distance(rng)` comparisons.
38
39 [endsect]
40
41