Skip to content

Commit 6b4fb1d

Browse files
[containers, strings, algorithms, re] Use \range where appropriate
(cooperated with commit 07e995f) Co-authored-by: Eelis van der Weegen <eelis@eelis.net>
1 parent 13ba96c commit 6b4fb1d

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

source/algorithms.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -7584,7 +7584,7 @@
75847584
are partitioned with respect to the expressions
75857585
\tcode{bool(invoke(comp, invoke(proj, e), value))} and
75867586
\tcode{!bool(invoke(comp, value, invoke(proj, e)))}.
7587-
Also, for all elements \tcode{e} of \tcode{[first, last)},
7587+
Also, for all elements \tcode{e} of \range{first}{last},
75887588
\tcode{bool(comp(e, value))} implies \tcode{!bool(comp(\brk{}value, e))}
75897589
for the overloads in namespace \tcode{std}.
75907590

@@ -7651,7 +7651,7 @@
76517651
are partitioned with respect to the expressions
76527652
\tcode{bool(invoke(comp, invoke(proj, e), value))} and
76537653
\tcode{!bool(invoke(comp, value, invoke(proj, e)))}.
7654-
Also, for all elements \tcode{e} of \tcode{[first, last)},
7654+
Also, for all elements \tcode{e} of \range{first}{last},
76557655
\tcode{bool(comp(e, value))} implies \tcode{!bool(comp(\brk{}value, e))}
76567656
for the overloads in namespace \tcode{std}.
76577657

@@ -10837,7 +10837,7 @@
1083710837
\pnum
1083810838
For the overloads with an \tcode{ExecutionPolicy} and a non-empty range,
1083910839
performs \tcode{*result = *first}.
10840-
Then, for every \tcode{d} in \tcode{[1, last - first - 1]},
10840+
Then, for every \tcode{d} in \crange{1}{last - first - 1},
1084110841
performs \tcode{*(result + d) = binary_op(*(first + d), *(first + (d - 1)))}.
1084210842

1084310843
\pnum

source/containers.tex

+19-19
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@
13091309
denote iterators that meet the \oldconcept{InputIterator} requirements
13101310
and refer to elements implicitly convertible to \tcode{value_type},
13111311
\item
1312-
\tcode{[i, j)} denotes a valid range,
1312+
\range{i}{j} denotes a valid range,
13131313
\item
13141314
\tcode{rg} denotes a value of a type \tcode{R}
13151315
that models \tcode{\exposconcept{container-compatible-range}<T>},
@@ -1322,7 +1322,7 @@
13221322
\item
13231323
\tcode{q} denotes a valid dereferenceable constant iterator to \tcode{a},
13241324
\item
1325-
\tcode{[q1, q2)} denotes a valid range of constant iterators in \tcode{a},
1325+
\range{q1}{q2} denotes a valid range of constant iterators in \tcode{a},
13261326
\item
13271327
\tcode{t} denotes an lvalue or a const rvalue of \tcode{X::value_type}, and
13281328
\item
@@ -1384,7 +1384,7 @@
13841384

13851385
\pnum
13861386
\effects
1387-
Constructs a sequence container equal to the range \tcode{[i, j)}.
1387+
Constructs a sequence container equal to the range \range{i}{j}.
13881388
Each iterator in the range \range{i}{j} is dereferenced exactly once.
13891389

13901390
\pnum
@@ -1579,7 +1579,7 @@
15791579

15801580
\pnum
15811581
\effects
1582-
Inserts copies of elements in \tcode{[i, j)} before \tcode{p}.
1582+
Inserts copies of elements in \range{i}{j} before \tcode{p}.
15831583
Each iterator in the range \range{i}{j} shall be dereferenced exactly once.
15841584

15851585
\pnum
@@ -1676,7 +1676,7 @@
16761676

16771677
\pnum
16781678
\effects
1679-
Erases the elements in the range \tcode{[q1, q2)}.
1679+
Erases the elements in the range \range{q1}{q2}.
16801680

16811681
\pnum
16821682
\returns
@@ -1733,7 +1733,7 @@
17331733

17341734
\pnum
17351735
\effects
1736-
Replaces elements in \tcode{a} with a copy of \tcode{[i, j)}.
1736+
Replaces elements in \tcode{a} with a copy of \range{i}{j}.
17371737
Invalidates all references, pointers and iterators
17381738
referring to the elements of \tcode{a}.
17391739
For \tcode{vector} and \tcode{deque},
@@ -2691,7 +2691,7 @@
26912691
\item
26922692
\tcode{r} denotes a valid dereferenceable iterator to \tcode{a},
26932693
\item
2694-
\tcode{[q1, q2)} denotes a valid range of constant iterators in \tcode{a},
2694+
\range{q1}{q2} denotes a valid range of constant iterators in \tcode{a},
26952695
\item
26962696
\tcode{il} designates an object of type \tcode{initializer_list<value_type>},
26972697
\item
@@ -4180,7 +4180,7 @@
41804180
\tcode{i} and \tcode{j} denote input iterators
41814181
that refer to \tcode{value_type},
41824182
\item
4183-
\tcode{[i, j)} denotes a valid range,
4183+
\range{i}{j} denotes a valid range,
41844184
\item
41854185
\tcode{rg} denotes a value of a type \tcode{R}
41864186
that models \tcode{\exposconcept{container-compatible-range}<value_type>},
@@ -4192,7 +4192,7 @@
41924192
\item
41934193
\tcode{r} denotes a valid dereferenceable iterator to \tcode{a},
41944194
\item
4195-
\tcode{[q1, q2)} denotes a valid range in \tcode{a},
4195+
\range{q1}{q2} denotes a valid range in \tcode{a},
41964196
\item
41974197
\tcode{il} denotes a value of type \tcode{initializer_list<value_type>},
41984198
\item
@@ -5004,7 +5004,7 @@
50045004

50055005
\pnum
50065006
\effects
5007-
Equivalent to \tcode{a.insert(t)} for each element in \tcode{[i,j)}.
5007+
Equivalent to \tcode{a.insert(t)} for each element in \range{i}{j}.
50085008

50095009
\pnum
50105010
\complexity
@@ -5367,7 +5367,7 @@
53675367

53685368
\pnum
53695369
\effects
5370-
Erases all elements in the range \tcode{[q1, q2)}.
5370+
Erases all elements in the range \range{q1}{q2}.
53715371

53725372
\pnum
53735373
\returns
@@ -5603,7 +5603,7 @@
56035603
The index of the bucket
56045604
in which elements with keys equivalent to \tcode{k} would be found,
56055605
if any such element existed.
5606-
The return value is in the range \tcode{[0, b.bucket_count())}.
5606+
The return value is in the range \range{0}{b.bucket_count()}.
56075607

56085608
\pnum
56095609
\complexity
@@ -5626,7 +5626,7 @@
56265626

56275627
\pnum
56285628
\ensures
5629-
The return value is in the range \tcode{[0, a_tran.bucket_count())}.
5629+
The return value is in the range \range{0}{a_tran.bucket_count()}.
56305630

56315631
\pnum
56325632
\returns
@@ -5651,7 +5651,7 @@
56515651

56525652
\pnum
56535653
\expects
5654-
\tcode{n} shall be in the range \tcode{[0, b.bucket_count())}.
5654+
\tcode{n} shall be in the range \range{0}{b.bucket_count()}.
56555655

56565656
\pnum
56575657
\returns
@@ -5674,7 +5674,7 @@
56745674

56755675
\pnum
56765676
\expects
5677-
\tcode{n} is in the range \tcode{[0, b.bucket_count())}.
5677+
\tcode{n} is in the range \range{0}{b.bucket_count()}.
56785678

56795679
\pnum
56805680
\returns
@@ -5698,7 +5698,7 @@
56985698

56995699
\pnum
57005700
\expects
5701-
\tcode{n} is in the range \tcode{[0, b.bucket_count())}.
5701+
\tcode{n} is in the range \range{0}{b.bucket_count()}.
57025702

57035703
\pnum
57045704
\returns
@@ -5721,7 +5721,7 @@
57215721

57225722
\pnum
57235723
\expects
5724-
\tcode{n} shall be in the range \tcode{[0, b.bucket_count())}.
5724+
\tcode{n} shall be in the range \range{0}{b.bucket_count()}.
57255725

57265726
\pnum
57275727
\returns
@@ -5745,7 +5745,7 @@
57455745

57465746
\pnum
57475747
\expects
5748-
\tcode{n} is in the range \tcode{[0, b.bucket_count())}.
5748+
\tcode{n} is in the range \range{0}{b.bucket_count()}.
57495749

57505750
\pnum
57515751
\returns
@@ -8362,7 +8362,7 @@
83628362
\begin{itemdescr}
83638363
\pnum
83648364
\expects
8365-
\tcode{[first, last)} is a valid range in \tcode{x}.
8365+
\range{first}{last} is a valid range in \tcode{x}.
83668366
\tcode{position} is not an iterator in the range \range{first}{last}.
83678367

83688368
\pnum

source/strings.tex

+9-9
Original file line numberDiff line numberDiff line change
@@ -139,31 +139,31 @@
139139
whether \tcode{c} is to be treated as less than \tcode{d}. & constant \\ \rowsep
140140
\tcode{X::compare(p,q,n)} & \tcode{int} &
141141
\returns
142-
\tcode{0} if for each \tcode{i} in \tcode{[0,n)}, \tcode{X::eq(p[i],q[i])}
143-
is \tcode{true}; else, a negative value if, for some \tcode{j} in \tcode{[0,n)},
144-
\tcode{X::lt(p[j],q[j])} is \tcode{true} and for each \tcode{i} in \tcode{[0,j)}
142+
\tcode{0} if for each \tcode{i} in \range{0}{n}, \tcode{X::eq(p[i],q[i])}
143+
is \tcode{true}; else, a negative value if, for some \tcode{j} in \range{0}{n},
144+
\tcode{X::lt(p[j],q[j])} is \tcode{true} and for each \tcode{i} in \range{0}{j}
145145
\tcode{X::eq(p[i],q[i])} is \tcode{true}; else a positive value. & linear \\ \rowsep
146146
\tcode{X::length(p)} & \tcode{size_t} &
147147
\returns
148148
the smallest \tcode{i} such that \tcode{X::eq(p[i],charT())} is \tcode{true}. & linear \\ \rowsep
149149
\tcode{X::find(p,n,c)} & \tcode{const X::char_type*} &
150150
\returns
151-
the smallest \tcode{q} in \tcode{[p,p+n)} such that
151+
the smallest \tcode{q} in \range{p}{p+n} such that
152152
\tcode{X::eq(*q,c)} is \tcode{true}, \tcode{nullptr} otherwise. & linear \\ \rowsep
153153
\tcode{X::move(s,p,n)} & \tcode{X::char_type*} &
154-
for each \tcode{i} in \tcode{[0,n)}, performs \tcode{X::assign(s[i],p[i])}.
155-
Copies correctly even where the ranges \tcode{[p,p+n)} and \tcode{[s,s+n)} overlap.\br \returns \tcode{s}. & linear \\ \rowsep
154+
for each \tcode{i} in \range{0}{n}, performs \tcode{X::assign(s[i],p[i])}.
155+
Copies correctly even where the ranges \range{p}{p+n} and \range{s}{s+n} overlap.\br \returns \tcode{s}. & linear \\ \rowsep
156156
\tcode{X::copy(s,p,n)} & \tcode{X::char_type*} &
157157
\expects
158158
The ranges \range{p}{p+n} and \range{s}{s+n} do not overlap.\par
159159
\returns
160160
\tcode{s}.\br
161161
for each \tcode{i} in
162-
\tcode{[0,n)}, performs \tcode{X::assign(s[i],p[i])}. & linear \\ \rowsep
162+
\range{0}{n}, performs \tcode{X::assign(s[i],p[i])}. & linear \\ \rowsep
163163
\tcode{X::assign(r,d)} & (not used) &
164164
assigns \tcode{r=d}. & constant \\ \rowsep
165165
\tcode{X::assign\-(s,n,c)} & \tcode{X::char_type*} &
166-
for each \tcode{i} in \tcode{[0,n)}, performs
166+
for each \tcode{i} in \range{0}{n}, performs
167167
\tcode{X::assign(s[i],c)}.\br
168168
\returns
169169
\tcode{s}. & linear \\ \rowsep
@@ -3916,7 +3916,7 @@
39163916
\pnum
39173917
\effects
39183918
Removes the characters in the range
3919-
\tcode{[first, last)}.
3919+
\range{first}{last}.
39203920

39213921
\pnum
39223922
\returns

source/text.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -12429,7 +12429,7 @@
1242912429
In all cases in which the call to \tcode{regex_search} returns \tcode{true},
1243012430
\tcode{match.prefix().first} shall be equal to the previous value of
1243112431
\tcode{match[0].second}, and for each index \tcode{i} in the half-open range
12432-
\tcode{[0, match.size())} for which \tcode{match[i].matched} is \tcode{true},
12432+
\range{0}{match.size()} for which \tcode{match[i].matched} is \tcode{true},
1243312433
\tcode{match.position(i)}
1243412434
shall return \tcode{distance(begin, match[i].\brk{}first)}.
1243512435

0 commit comments

Comments
 (0)