-
Notifications
You must be signed in to change notification settings - Fork 8
/
deprecated.tex
165 lines (142 loc) · 6.49 KB
/
deprecated.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
%!TEX root = N4382.tex
\normannex{depr}{Compatibility features}
\rSec1[depr.general]{General}
\pnum
This Clause describes features of this document that are specified for compatibility with
existing implementations.
\pnum
These are deprecated features, where
\term{deprecated}
is defined as:
Normative for the current edition of this document,
but having been identified as a candidate for removal from future revisions.
An implementation may declare library names and entities described in this section with the
\tcode{deprecated} attribute~(\cxxref{dcl.attr.deprecated}).
\rSec1[depr.rvalue.ranges]{Rvalue range access}
\pnum
Use of the range access customization point objects
\tcode{begin}, \tcode{end},
\tcode{cbegin}, \tcode{cend},
\tcode{rbegin}, \tcode{rend},
\tcode{crbegin}, \tcode{crend},
\tcode{data}, and \tcode{cdata}
with rvalue arguments is deprecated. In a future revision of this document,
such usage could become ill-formed.
\rSec1[depr.algo.range-and-a-half]{Range-and-a-half algorithms}
\pnum
The following algorithm signatures are deemed unsafe and are deprecated in this document.
\pnum
Overloads of algorithms that take a \tcode{Range} argument and a forwarding
reference parameter \tcode{first2_} behave as if they are implemented by calling
\tcode{begin} and \tcode{end} on the \tcode{Range} and dispatching to the
overload that takes separate iterator and sentinel arguments, perfectly forwarding
\tcode{first2_}.
\begin{codeblock}
template <InputIterator I1, Sentinel<I1> S1, class I2, class R = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires InputIterator<decay_t<I2>> && !Range<I2> &&
IndirectRelation<R, projected<I1, Proj1>, projected<decay_t<I2>, Proj2>>
tagged_pair<tag::in1(I1), tag::in2(decay_t<I2>)>
mismatch(I1 first1, S1 last1, I2&& first2_, R comp = R{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
template <InputRange Rng1, class I2, class R = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires InputIterator<decay_t<I2>> && !Range<I2> &&
IndirectRelation<R, projected<iterator_t<Rng1>, Proj1>, projected<decay_t<I2>, Proj2>>
tagged_pair<tag::in1(safe_iterator_t<Rng1>), tag::in2(decay_t<I2>)>
mismatch(Rng1&& rng1, I2&& first2_, R comp = R{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
\end{codeblock}
\pnum
\effects
Equivalent to:
\begin{codeblock}
return mismatch(first1, last1, std::forward<I2>(first2_), unreachable{}, comp, proj1, proj2);
\end{codeblock}
except that the underlying algorithm never increments \tcode{first2} more than \tcode{last1 - first1} times.
\begin{codeblock}
template <InputIterator I1, Sentinel<I1> S1, class I2,
class R = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires InputIterator<decay_t<I2>> && !Range<I2> &&
IndirectlyComparable<I1, decay_t<I2>, R, Proj1, Proj2>
bool equal(I1 first1, S1 last1, I2&& first2_, R comp = R{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
template <InputRange Rng1, class I2, class R = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires InputIterator<decay_t<I2>> && !Range<I2> &&
IndirectlyComparable<iterator_t<Rng1>, decay_t<I2>, R, Proj1, Proj2>
bool equal(Rng1&& rng1, I2&& first2_, R comp = R{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
\end{codeblock}
\pnum
\effects
Equivalent to:
\begin{codeblock}
return first1 == mismatch(first1, last1, std::forward<I2>(first2_), comp, proj1, proj2).in1();
\end{codeblock}
\begin{codeblock}
template <ForwardIterator I1, Sentinel<I1> S1, class I2,
class R = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
IndirectlyComparable<I1, decay_t<I2>, R, Proj1, Proj2>
bool is_permutation(I1 first1, S1 last1, I2&& first2_, R comp = R{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
template <ForwardRange Rng1, class I2, class R = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
IndirectlyComparable<iterator_t<Rng1>, decay_t<I2>, R, Proj1, Proj2>
bool is_permutation(Rng1&& rng1, I2&& first2_, R comp = R{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
\end{codeblock}
\pnum
\effects
Equivalent to:
\begin{codeblock}
auto first2 = std::forward<I2>(first2_);
return is_permutation(first1, last1, first2, next(first2, distance(first1, last1)),
comp, proj1, proj2);
\end{codeblock}
\begin{codeblock}
template <ForwardIterator I1, Sentinel<I1> S1, class I2>
requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
IndirectlySwappable<I1, decay_t<I2>>
tagged_pair<tag::in1(I1), tag::in2(decay_t<I2>)>
swap_ranges(I1 first1, S1 last1, I2&& first2_);
template <ForwardRange Rng, class I2>
requires ForwardIterator<decay_t<I2>> && !Range<I2> &&
IndirectlySwappable<iterator_t<Rng>, decay_t<I2>>
tagged_pair<tag::in1(safe_iterator_t<Rng>), tag::in2(decay_t<I2>)>
swap_ranges(Rng&& rng1, I2&& first2_);
\end{codeblock}
\pnum
\effects
Equivalent to:
\begin{codeblock}
auto first2 = std::forward<I2>(first2_);
return swap_ranges(first1, last1, first2, next(first2, distance(first1, last1)));
\end{codeblock}
\begin{codeblock}
template <InputIterator I1, Sentinel<I1> S1, class I2, WeaklyIncrementable O,
CopyConstructible F, class Proj1 = identity, class Proj2 = identity>
requires InputIterator<decay_t<I2>> && !Range<I2> &&
Writable<O, indirect_result_of_t<F&(projected<I1, Proj1>,
projected<decay_t<I2>, Proj2>)>>
tagged_tuple<tag::in1(I1), tag::in2(decay_t<I2>), tag::out(O)>
transform(I1 first1, S1 last1, I2&& first2_, O result,
F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
template <InputRange Rng, class I2, WeaklyIncrementable O, CopyConstructible F,
class Proj1 = identity, class Proj2 = identity>
requires InputIterator<decay_t<I2>> && !Range<I2> &&
Writable<O, indirect_result_of_t<F&(
projected<iterator_t<Rng>, Proj1>, projected<decay_t<I2>, Proj2>>)>
tagged_tuple<tag::in1(safe_iterator_t<Rng>), tag::in2(decay_t<I2>), tag::out(O)>
transform(Rng&& rng1, I2&& first2_, O result,
F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});
\end{codeblock}
\pnum
\effects
Equivalent to:
\begin{codeblock}
return transform(first1, last1, std::forward<I2>(first2_), unreachable{}, pred, proj1, proj2);
\end{codeblock}
except that the underlying algorithm never increments \tcode{first2} more than \tcode{last1 - first1} times.