Skip to content

Commit c2dac40

Browse files
authored
Merge 2019-02 LWG Motion 11
P1464R1 Mandating the Standard Library: Clause 22 - Iterators library Fixes #2702.
2 parents c483ffd + 5d28601 commit c2dac40

File tree

1 file changed

+38
-64
lines changed

1 file changed

+38
-64
lines changed

source/iterators.tex

+38-64
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,7 @@
17641764
\tcode{*r} &
17651765
unspecified &
17661766
&
1767-
\requires \tcode{r} is dereferenceable. \\ \rowsep
1767+
\expects \tcode{r} is dereferenceable. \\ \rowsep
17681768

17691769
\tcode{++r} &
17701770
\tcode{X\&} &
@@ -1830,23 +1830,23 @@
18301830
\tcode{a != b} &
18311831
contextually convertible to \tcode{bool} &
18321832
\tcode{!(a == b)} &
1833-
\requires \orange{a}{b} is in the domain of \tcode{==}. \\ \rowsep
1833+
\expects \orange{a}{b} is in the domain of \tcode{==}. \\ \rowsep
18341834

18351835
\tcode{*a} &
18361836
\tcode{reference}, convertible to \tcode{T} &
18371837
&
1838-
\requires \tcode{a} is dereferenceable.\br
1838+
\expects \tcode{a} is dereferenceable.\br
18391839
The expression\br \tcode{(void)*a, *a} is equivalent to \tcode{*a}.\br
18401840
If \tcode{a == b} and \orange{a}{b} is in the domain of \tcode{==}
18411841
then \tcode{*a} is equivalent to \tcode{*b}. \\ \rowsep
18421842
\tcode{a->m} &
18431843
&
18441844
\tcode{(*a).m} &
1845-
\requires \tcode{a} is dereferenceable. \\ \rowsep
1845+
\expects \tcode{a} is dereferenceable. \\ \rowsep
18461846
\tcode{++r} &
18471847
\tcode{X\&} &
18481848
&
1849-
\requires \tcode{r} is dereferenceable.\br
1849+
\expects \tcode{r} is dereferenceable.\br
18501850
\ensures \tcode{r} is dereferenceable or \tcode{r} is past-the-end;\br
18511851
any copies of the previous value of \tcode{r} are no longer
18521852
required to be dereferenceable nor to be in the domain of \tcode{==}. \\ \rowsep
@@ -1905,27 +1905,27 @@
19051905
\tcode{*r = o} &
19061906
result is not used &
19071907
&
1908-
\remarks\ After this operation \tcode{r} is not required to be dereferenceable.\br
1908+
\remarks After this operation \tcode{r} is not required to be dereferenceable.\br
19091909
\ensures \tcode{r} is incrementable. \\ \rowsep
19101910

19111911
\tcode{++r} &
19121912
\tcode{X\&} &
19131913
&
19141914
\tcode{addressof(r) == addressof(++r)}.\br
1915-
\remarks\ After this operation \tcode{r} is not required to be dereferenceable.\br
1915+
\remarks After this operation \tcode{r} is not required to be dereferenceable.\br
19161916
\ensures \tcode{r} is incrementable. \\ \rowsep
19171917

19181918
\tcode{r++} &
19191919
convertible to \tcode{const X\&} &
19201920
\tcode{\{ X tmp = r;}\br
19211921
\tcode{ ++r;}\br
19221922
\tcode{ return tmp; \}} &
1923-
\remarks\ After this operation \tcode{r} is not required to be dereferenceable.\br
1923+
\remarks After this operation \tcode{r} is not required to be dereferenceable.\br
19241924
\ensures \tcode{r} is incrementable. \\ \rowsep
19251925

19261926
\tcode{*r++ = o} &
19271927
result is not used &&
1928-
\remarks\ After this operation \tcode{r} is not required to be dereferenceable.\br
1928+
\remarks After this operation \tcode{r} is not required to be dereferenceable.\br
19291929
\ensures \tcode{r} is incrementable. \\
19301930
\end{libreqtab4b}
19311931

@@ -2048,7 +2048,7 @@
20482048
\tcode{\dcr r} &
20492049
\tcode{X\&} &
20502050
&
2051-
\requires there exists \tcode{s} such that \tcode{r == ++s}.\br
2051+
\expects there exists \tcode{s} such that \tcode{r == ++s}.\br
20522052
\ensures \tcode{r} is dereferenceable.\br
20532053
\tcode{\dcr(++r) == r}.\br
20542054
\tcode{\dcr r == \dcr s} implies \tcode{r == s}.\br
@@ -2111,7 +2111,7 @@
21112111
\tcode{r -= n} &
21122112
\tcode{X\&} &
21132113
\tcode{return r += -n;} &
2114-
\requires the absolute value of \tcode{n} is in the range of
2114+
\expects the absolute value of \tcode{n} is in the range of
21152115
representable values of \tcode{difference_type}. \\ \rowsep
21162116

21172117
\tcode{a - n} &
@@ -2122,7 +2122,7 @@
21222122
\tcode{b - a} &
21232123
\tcode{difference_type} &
21242124
\tcode{return n} &
2125-
\requires there exists a value \tcode{n} of type \tcode{difference_type} such that \tcode{a + n == b}.\br
2125+
\expects there exists a value \tcode{n} of type \tcode{difference_type} such that \tcode{a + n == b}.\br
21262126
\tcode{b == a + (b - a)}. \\ \rowsep
21272127

21282128
\tcode{a[n]} &
@@ -3269,7 +3269,7 @@
32693269
\begin{itemdescr}
32703270
\pnum
32713271
\constraints
3272-
The expression \tcode{x.base() == y.base()} shall be valid and
3272+
\tcode{x.base() == y.base()} is well-formed and
32733273
convertible to \tcode{bool}.
32743274

32753275
\pnum
@@ -3288,7 +3288,7 @@
32883288
\begin{itemdescr}
32893289
\pnum
32903290
\constraints
3291-
The expression \tcode{x.base() != y.base()} shall be valid and
3291+
\tcode{x.base() != y.base()} is well-formed and
32923292
convertible to \tcode{bool}.
32933293

32943294
\pnum
@@ -3307,7 +3307,7 @@
33073307
\begin{itemdescr}
33083308
\pnum
33093309
\constraints
3310-
The expression \tcode{x.base() > y.base()} shall be valid and
3310+
\tcode{x.base() > y.base()} is well-formed and
33113311
convertible to \tcode{bool}.
33123312

33133313
\pnum
@@ -3326,7 +3326,7 @@
33263326
\begin{itemdescr}
33273327
\pnum
33283328
\constraints
3329-
The expression \tcode{x.base() < y.base()} shall be valid and
3329+
\tcode{x.base() < y.base()} is well-formed and
33303330
convertible to \tcode{bool}.
33313331

33323332
\pnum
@@ -3345,7 +3345,7 @@
33453345
\begin{itemdescr}
33463346
\pnum
33473347
\constraints
3348-
The expression \tcode{x.base() >= y.base()} shall be valid and
3348+
\tcode{x.base() >= y.base()} is well-formed and
33493349
convertible to \tcode{bool}.
33503350

33513351
\pnum
@@ -3364,7 +3364,7 @@
33643364
\begin{itemdescr}
33653365
\pnum
33663366
\constraints
3367-
The expression \tcode{x.base() <= y.base()} shall be valid and
3367+
\tcode{x.base() <= y.base()} is well-formed and
33683368
convertible to \tcode{bool}.
33693369

33703370
\pnum
@@ -4014,12 +4014,11 @@
40144014

40154015
\begin{itemdescr}
40164016
\pnum
4017-
\effects Constructs a \tcode{move_iterator}, initializing
4018-
\tcode{current} with \tcode{u.base()}.
4017+
\mandates \tcode{U} is convertible to \tcode{Iterator}.
40194018

40204019
\pnum
4021-
\requires \tcode{U} shall be convertible to
4022-
\tcode{Iterator}.
4020+
\effects Constructs a \tcode{move_iterator}, initializing
4021+
\tcode{current} with \tcode{u.base()}.
40234022
\end{itemdescr}
40244023

40254024
\indexlibrarymember{operator=}{move_iterator}%
@@ -4029,12 +4028,11 @@
40294028

40304029
\begin{itemdescr}
40314030
\pnum
4032-
\effects Assigns \tcode{u.base()} to
4033-
\tcode{current}.
4031+
\mandates \tcode{U} is convertible to \tcode{Iterator}.
40344032

40354033
\pnum
4036-
\requires \tcode{U} shall be convertible to
4037-
\tcode{Iterator}.
4034+
\effects Assigns \tcode{u.base()} to
4035+
\tcode{current}.
40384036
\end{itemdescr}
40394037

40404038
\rSec3[move.iter.op.conv]{Conversion}
@@ -4206,7 +4204,7 @@
42064204
\begin{itemdescr}
42074205
\pnum
42084206
\constraints
4209-
The expression \tcode{x.base() == y.base()} shall be valid and
4207+
\tcode{x.base() == y.base()} is well-formed and
42104208
convertible to \tcode{bool}.
42114209

42124210
\pnum
@@ -4229,7 +4227,7 @@
42294227
\begin{itemdescr}
42304228
\pnum
42314229
\constraints
4232-
The expression \tcode{x.base() == y.base()} shall be valid and
4230+
\tcode{x.base() == y.base()} is well-formed and
42334231
convertible to \tcode{bool}.
42344232

42354233
\pnum
@@ -4245,7 +4243,7 @@
42454243
\begin{itemdescr}
42464244
\pnum
42474245
\constraints
4248-
The expression \tcode{x.base() < y.base()} shall be valid and
4246+
\tcode{x.base() < y.base()} is well-formed and
42494247
convertible to \tcode{bool}.
42504248

42514249
\pnum
@@ -4261,7 +4259,7 @@
42614259
\begin{itemdescr}
42624260
\pnum
42634261
\constraints
4264-
The expression \tcode{y.base() < x.base()} shall be valid and
4262+
\tcode{y.base() < x.base()} is well-formed and
42654263
convertible to \tcode{bool}.
42664264

42674265
\pnum
@@ -4277,7 +4275,7 @@
42774275
\begin{itemdescr}
42784276
\pnum
42794277
\constraints
4280-
The expression \tcode{y.base() < x.base()} shall be valid and
4278+
\tcode{y.base() < x.base()} is well-formed and
42814279
convertible to \tcode{bool}.
42824280

42834281
\pnum
@@ -4293,7 +4291,7 @@
42934291
\begin{itemdescr}
42944292
\pnum
42954293
\constraints
4296-
The expression \tcode{x.base() < y.base()} shall be valid and
4294+
\tcode{x.base() < y.base()} is well-formed and
42974295
convertible to \tcode{bool}.
42984296

42994297
\pnum
@@ -4331,7 +4329,7 @@
43314329
\begin{itemdescr}
43324330
\pnum
43334331
\constraints
4334-
The expression \tcode{x + n} shall be valid and have type \tcode{Iterator}.
4332+
\tcode{x + n} is well-formed and has type \tcode{Iterator}.
43354333

43364334
\pnum
43374335
\returns \tcode{x + n}.
@@ -5660,10 +5658,6 @@
56605658
\end{itemdecl}
56615659

56625660
\begin{itemdescr}
5663-
\pnum
5664-
\effects
5665-
Constructs a copy of \tcode{x}.
5666-
56675661
\pnum
56685662
\ensures \tcode{in_stream == x.in_stream} is \tcode{true}.
56695663

@@ -5745,6 +5739,9 @@
57455739
\end{itemdecl}
57465740

57475741
\begin{itemdescr}
5742+
\pnum
5743+
\expects \tcode{in_stream != nullptr} is \tcode{true}.
5744+
57485745
\pnum
57495746
\effects Equivalent to:
57505747
\begin{codeblock}
@@ -5870,29 +5867,6 @@
58705867
\tcode{delim} with \tcode{delimiter}.
58715868
\end{itemdescr}
58725869

5873-
5874-
\indexlibrary{\idxcode{ostream_iterator}!constructor}%
5875-
\begin{itemdecl}
5876-
ostream_iterator(const ostream_iterator& x);
5877-
\end{itemdecl}
5878-
5879-
\begin{itemdescr}
5880-
\pnum
5881-
\effects
5882-
Constructs a copy of \tcode{x}.
5883-
\end{itemdescr}
5884-
5885-
\indexlibrary{\idxcode{ostream_iterator}!destructor}%
5886-
\begin{itemdecl}
5887-
~ostream_iterator();
5888-
\end{itemdecl}
5889-
5890-
\begin{itemdescr}
5891-
\pnum
5892-
\effects
5893-
The iterator is destroyed.
5894-
\end{itemdescr}
5895-
58965870
\rSec3[ostream.iterator.ops]{Operations}
58975871

58985872
\indexlibrarymember{operator=}{ostream_iterator}%
@@ -6248,9 +6222,9 @@
62486222

62496223
\begin{itemdescr}
62506224
\pnum
6251-
\requires
6225+
\expects
62526226
\tcode{s.rdbuf()}
6253-
shall not be a null pointer.
6227+
is not a null pointer.
62546228

62556229
\pnum
62566230
\effects
@@ -6265,9 +6239,9 @@
62656239

62666240
\begin{itemdescr}
62676241
\pnum
6268-
\requires
6242+
\expects
62696243
\tcode{s}
6270-
shall not be a null pointer.
6244+
is not a null pointer.
62716245

62726246
\pnum
62736247
\effects

0 commit comments

Comments
 (0)