Skip to content

Commit 2c27a4b

Browse files
jensmaurerzygoloid
authored andcommitted
P1035R7 Input range adaptors
1 parent 7e862f0 commit 2c27a4b

File tree

4 files changed

+2017
-894
lines changed

4 files changed

+2017
-894
lines changed

source/algorithms.tex

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -877,15 +877,15 @@
877877
count(I first, S last, const T& value, Proj proj = {});
878878
template<InputRange R, class T, class Proj = identity>
879879
requires IndirectRelation<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
880-
constexpr iter_difference_t<iterator_t<R>>
880+
constexpr range_difference_t<R>
881881
count(R&& r, const T& value, Proj proj = {});
882882
template<InputIterator I, Sentinel<I> S, class Proj = identity,
883883
IndirectUnaryPredicate<projected<I, Proj>> Pred>
884884
constexpr iter_difference_t<I>
885885
count_if(I first, S last, Pred pred, Proj proj = {});
886886
template<InputRange R, class Proj = identity,
887887
IndirectUnaryPredicate<projected<iterator_t<R>, Proj>> Pred>
888-
constexpr iter_difference_t<iterator_t<R>>
888+
constexpr range_difference_t<R>
889889
count_if(R&& r, Pred pred, Proj proj = {});
890890
}
891891

@@ -1116,7 +1116,7 @@
11161116
class Proj = identity>
11171117
requires IndirectlyComparable<iterator_t<R>, const T*, Pred, Proj>
11181118
constexpr safe_subrange_t<R>
1119-
search_n(R&& r, iter_difference_t<iterator_t<R>> count,
1119+
search_n(R&& r, range_difference_t<R> count,
11201120
const T& value, Pred pred = {}, Proj proj = {});
11211121
}
11221122

@@ -1663,7 +1663,7 @@
16631663
IndirectRelation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
16641664
requires IndirectlyCopyable<iterator_t<R>, O> &&
16651665
(ForwardIterator<iterator_t<R>> ||
1666-
(InputIterator<O> && Same<iter_value_t<iterator_t<R>>, iter_value_t<O>>) ||
1666+
(InputIterator<O> && Same<range_value_t<R>, iter_value_t<O>>) ||
16671667
IndirectlyCopyableStorable<iterator_t<R>, O>)
16681668
constexpr unique_copy_result<safe_iterator_t<R>, O>
16691669
unique_copy(R&& r, O result, C comp = {}, Proj proj = {});
@@ -2640,8 +2640,8 @@
26402640
constexpr T min(initializer_list<T> r, Comp comp = {}, Proj proj = {});
26412641
template<InputRange R, class Proj = identity,
26422642
IndirectStrictWeakOrder<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2643-
requires IndirectlyCopyableStorable<iterator_t<R>, iter_value_t<iterator_t<R>>*>
2644-
constexpr iter_value_t<iterator_t<R>>
2643+
requires IndirectlyCopyableStorable<iterator_t<R>, range_value_t<R>*>
2644+
constexpr range_value_t<R>
26452645
min(R&& r, Comp comp = {}, Proj proj = {});
26462646
}
26472647

@@ -2662,8 +2662,8 @@
26622662
constexpr T max(initializer_list<T> r, Comp comp = {}, Proj proj = {});
26632663
template<InputRange R, class Proj = identity,
26642664
IndirectStrictWeakOrder<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2665-
requires IndirectlyCopyableStorable<iterator_t<R>, iter_value_t<iterator_t<R>>*>
2666-
constexpr iter_value_t<iterator_t<R>>
2665+
requires IndirectlyCopyableStorable<iterator_t<R>, range_value_t<R>*>
2666+
constexpr range_value_t<R>
26672667
max(R&& r, Comp comp = {}, Proj proj = {});
26682668
}
26692669

@@ -2704,8 +2704,8 @@
27042704
minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {});
27052705
template<InputRange R, class Proj = identity,
27062706
IndirectStrictWeakOrder<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2707-
requires IndirectlyCopyableStorable<iterator_t<R>, iter_value_t<iterator_t<R>>*>
2708-
constexpr minmax_result<iter_value_t<iterator_t<R>>>
2707+
requires IndirectlyCopyableStorable<iterator_t<R>, range_value_t<R>*>
2708+
constexpr minmax_result<range_value_t<R>>
27092709
minmax(R&& r, Comp comp = {}, Proj proj = {});
27102710
}
27112711

@@ -3512,15 +3512,15 @@
35123512
ranges::count(I first, S last, const T& value, Proj proj = {});
35133513
template<InputRange R, class T, class Proj = identity>
35143514
requires IndirectRelation<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
3515-
constexpr iter_difference_t<iterator_t<R>>
3515+
constexpr range_difference_t<R>
35163516
ranges::count(R&& r, const T& value, Proj proj = {});
35173517
template<InputIterator I, Sentinel<I> S, class Proj = identity,
35183518
IndirectUnaryPredicate<projected<I, Proj>> Pred>
35193519
constexpr iter_difference_t<I>
35203520
ranges::count_if(I first, S last, Pred pred, Proj proj = {});
35213521
template<InputRange R, class Proj = identity,
35223522
IndirectUnaryPredicate<projected<iterator_t<R>, Proj>> Pred>
3523-
constexpr iter_difference_t<iterator_t<R>>
3523+
constexpr range_difference_t<R>
35243524
ranges::count_if(R&& r, Pred pred, Proj proj = {});
35253525
\end{itemdecl}
35263526

@@ -4013,7 +4013,7 @@
40134013
class Proj = identity>
40144014
requires IndirectlyComparable<iterator_t<R>, const T*, Pred, Proj>
40154015
constexpr safe_subrange_t<R>
4016-
ranges::search_n(R&& r, iter_difference_t<iterator_t<R>> count,
4016+
ranges::search_n(R&& r, range_difference_t<R> count,
40174017
const T& value, Pred pred = {}, Proj proj = {});
40184018
\end{itemdecl}
40194019

@@ -5234,7 +5234,7 @@
52345234
IndirectRelation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
52355235
requires IndirectlyCopyable<iterator_t<R>, O> &&
52365236
(ForwardIterator<iterator_t<R>> ||
5237-
(InputIterator<O> && Same<iter_value_t<iterator_t<R>>, iter_value_t<O>>) ||
5237+
(InputIterator<O> && Same<range_value_t<R>, iter_value_t<O>>) ||
52385238
IndirectlyCopyableStorable<iterator_t<R>, O>)
52395239
constexpr ranges::unique_copy_result<safe_iterator_t<R>, O>
52405240
ranges::unique_copy(R&& r, O result, C comp = {}, Proj proj = {});
@@ -7913,8 +7913,8 @@
79137913
constexpr T ranges::min(initializer_list<T> r, Comp comp = {}, Proj proj = {});
79147914
template<InputRange R, class Proj = identity,
79157915
IndirectStrictWeakOrder<projected<iterator_t<R>, Proj>> Comp = ranges::less>
7916-
requires IndirectlyCopyableStorable<iterator_t<R>, iter_value_t<iterator_t<R>>*>
7917-
constexpr iter_value_t<iterator_t<R>>
7916+
requires IndirectlyCopyableStorable<iterator_t<R>, range_value_t<R>*>
7917+
constexpr range_value_t<R>
79187918
ranges::min(R&& r, Comp comp = {}, Proj proj = {});
79197919
\end{itemdecl}
79207920

@@ -7990,8 +7990,8 @@
79907990
constexpr T ranges::max(initializer_list<T> r, Comp comp = {}, Proj proj = {});
79917991
template<InputRange R, class Proj = identity,
79927992
IndirectStrictWeakOrder<projected<iterator_t<R>, Proj>> Comp = ranges::less>
7993-
requires IndirectlyCopyableStorable<iterator_t<R>, iter_value_t<iterator_t<R>>*>
7994-
constexpr iter_value_t<iterator_t<R>>
7993+
requires IndirectlyCopyableStorable<iterator_t<R>, range_value_t<R>*>
7994+
constexpr range_value_t<R>
79957995
ranges::max(R&& r, Comp comp = {}, Proj proj = {});
79967996
\end{itemdecl}
79977997

@@ -8070,8 +8070,8 @@
80708070
ranges::minmax(initializer_list<T> r, Comp comp = {}, Proj proj = {});
80718071
template<InputRange R, class Proj = identity,
80728072
IndirectStrictWeakOrder<projected<iterator_t<R>, Proj>> Comp = ranges::less>
8073-
requires IndirectlyCopyableStorable<iterator_t<R>, iter_value_t<iterator_t<R>>*>
8074-
constexpr ranges::minmax_result<iter_value_t<iterator_t<R>>>
8073+
requires IndirectlyCopyableStorable<iterator_t<R>, range_value_t<R>*>
8074+
constexpr ranges::minmax_result<range_value_t<R>>
80758075
ranges::minmax(R&& r, Comp comp = {}, Proj proj = {});
80768076
\end{itemdecl}
80778077

source/iterators.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
template<Iterator I, Sentinel<I> S>
244244
constexpr iter_difference_t<I> distance(I first, S last);
245245
template<Range R>
246-
constexpr iter_difference_t<iterator_t<R>> distance(R&& r);
246+
constexpr range_difference_t<R> distance(R&& r);
247247

248248
// \ref{range.iter.op.next}, \tcode{ranges::next}
249249
template<Iterator I>
@@ -2833,7 +2833,7 @@
28332833
\indexlibrary{\idxcode{distance}}%
28342834
\begin{itemdecl}
28352835
template<Range R>
2836-
constexpr iter_difference_t<iterator_t<R>> ranges::distance(R&& r);
2836+
constexpr range_difference_t<R> ranges::distance(R&& r);
28372837
\end{itemdecl}
28382838

28392839
\begin{itemdescr}

0 commit comments

Comments
 (0)