From Jason Turner

[alg.count]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphv3qv_9r/{from.md → to.md} +27 -4
tmp/tmphv3qv_9r/{from.md → to.md} RENAMED
@@ -1,12 +1,13 @@
1
  ### Count <a id="alg.count">[[alg.count]]</a>
2
 
3
  ``` cpp
4
- template<class InputIterator, class T>
5
  constexpr typename iterator_traits<InputIterator>::difference_type
6
  count(InputIterator first, InputIterator last, const T& value);
7
- template<class ExecutionPolicy, class ForwardIterator, class T>
 
8
  typename iterator_traits<ForwardIterator>::difference_type
9
  count(ExecutionPolicy&& exec,
10
  ForwardIterator first, ForwardIterator last, const T& value);
11
 
12
  template<class InputIterator, class Predicate>
@@ -15,26 +16,48 @@ template<class InputIterator, class Predicate>
15
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
16
  typename iterator_traits<ForwardIterator>::difference_type
17
  count_if(ExecutionPolicy&& exec,
18
  ForwardIterator first, ForwardIterator last, Predicate pred);
19
 
20
- template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
 
21
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
22
  constexpr iter_difference_t<I>
23
  ranges::count(I first, S last, const T& value, Proj proj = {});
24
- template<input_range R, class T, class Proj = identity>
25
  requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
26
  constexpr range_difference_t<R>
27
  ranges::count(R&& r, const T& value, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
28
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
29
  indirect_unary_predicate<projected<I, Proj>> Pred>
30
  constexpr iter_difference_t<I>
31
  ranges::count_if(I first, S last, Pred pred, Proj proj = {});
32
  template<input_range R, class Proj = identity,
33
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
34
  constexpr range_difference_t<R>
35
  ranges::count_if(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
36
  ```
37
 
38
  Let E be:
39
 
40
  - `*i == value` for the overloads with no parameter `pred` or `proj`;
 
1
  ### Count <a id="alg.count">[[alg.count]]</a>
2
 
3
  ``` cpp
4
+ template<class InputIterator, class T = iterator_traits<InputIterator>::value_type>
5
  constexpr typename iterator_traits<InputIterator>::difference_type
6
  count(InputIterator first, InputIterator last, const T& value);
7
+ template<class ExecutionPolicy, class ForwardIterator,
8
+ class T = iterator_traits<ForwardIterator>::value_type>
9
  typename iterator_traits<ForwardIterator>::difference_type
10
  count(ExecutionPolicy&& exec,
11
  ForwardIterator first, ForwardIterator last, const T& value);
12
 
13
  template<class InputIterator, class Predicate>
 
16
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
17
  typename iterator_traits<ForwardIterator>::difference_type
18
  count_if(ExecutionPolicy&& exec,
19
  ForwardIterator first, ForwardIterator last, Predicate pred);
20
 
21
+ template<input_iterator I, sentinel_for<I> S, class Proj = identity,
22
+ class T = projected_value_t<I, Proj>>
23
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
24
  constexpr iter_difference_t<I>
25
  ranges::count(I first, S last, const T& value, Proj proj = {});
26
+ template<input_range R, class Proj = identity, class T = projected_value_t<iterator_t<R>, Proj>>
27
  requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
28
  constexpr range_difference_t<R>
29
  ranges::count(R&& r, const T& value, Proj proj = {});
30
+
31
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
32
+ class Proj = identity, class T = projected_value_t<I, Proj>>
33
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
34
+ iter_difference_t<I>
35
+ ranges::count(Ep&& exec, I first, S last, const T& value, Proj proj = {});
36
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
37
+ class T = projected_value_t<iterator_t<R>, Proj>>
38
+ requires indirect_binary_predicate<ranges::equal_to,
39
+ projected<iterator_t<R>, Proj>, const T*>
40
+ range_difference_t<R> ranges::count(Ep&& exec, R&& r, const T& value, Proj proj = {});
41
+
42
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
43
  indirect_unary_predicate<projected<I, Proj>> Pred>
44
  constexpr iter_difference_t<I>
45
  ranges::count_if(I first, S last, Pred pred, Proj proj = {});
46
  template<input_range R, class Proj = identity,
47
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
48
  constexpr range_difference_t<R>
49
  ranges::count_if(R&& r, Pred pred, Proj proj = {});
50
+
51
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
52
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
53
+ iter_difference_t<I>
54
+ ranges::count_if(Ep&& exec, I first, S last, Pred pred, Proj proj = {});
55
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
56
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
57
+ range_difference_t<R>
58
+ ranges::count_if(Ep&& exec, R&& r, Pred pred, Proj proj = {});
59
  ```
60
 
61
  Let E be:
62
 
63
  - `*i == value` for the overloads with no parameter `pred` or `proj`;