MCPcopy Create free account
hub / github.com/HelenOS/helenos / count

Function count

uspace/lib/cpp/include/__bits/algorithm.hpp:189–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187
188 template<class InputIterator, class T>
189 typename iterator_traits<InputIterator>::difference_type
190 count(InputIterator first, InputIterator last, const T& value)
191 {
192 typename iterator_traits<InputIterator>::difference_type cnt{};
193
194 while (first != last)
195 {
196 if (*first++ == value)
197 ++cnt;
198 }
199
200 return cnt;
201 }
202
203 template<class InputIterator, class Predicate>
204 typename iterator_traits<InputIterator>::difference_type

Callers 6

test_non_modifyingMethod · 0.85
countMethod · 0.85
countMethod · 0.85
allMethod · 0.85
anyMethod · 0.85
noneMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_non_modifyingMethod · 0.68