Skip to content

Commit 618411a

Browse files
[iterators.counted] Exposition-only style for current and length
1 parent fbf3dfd commit 618411a

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

source/iterators.tex

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6001,15 +6001,15 @@
60016001
const counted_iterator& x, const counted_iterator<I2>& y);
60026002

60036003
friend constexpr decltype(auto) iter_move(const counted_iterator& i)
6004-
noexcept(noexcept(ranges::iter_move(i.current)))
6004+
noexcept(noexcept(ranges::iter_move(i.@\exposid{current}@)))
60056005
requires @\libconcept{input_iterator}@<I>;
60066006
template<@\libconcept{indirectly_swappable}@<I> I2>
60076007
friend constexpr void iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
6008-
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
6008+
noexcept(noexcept(ranges::iter_swap(x.@\exposid{current}@, y.@\exposid{current}@)));
60096009

60106010
private:
6011-
I current = I(); // \expos
6012-
iter_difference_t<I> length = 0; // \expos
6011+
I @\exposid{current}@ = I(); // \expos
6012+
iter_difference_t<I> @\exposid{length}@ = 0; // \expos
60136013
};
60146014

60156015
template<@\libconcept{input_iterator}@ I>
@@ -6035,8 +6035,8 @@
60356035

60366036
\pnum
60376037
\effects
6038-
Initializes \tcode{current} with \tcode{std::move(i)} and
6039-
\tcode{length} with \tcode{n}.
6038+
Initializes \exposid{current} with \tcode{std::move(i)} and
6039+
\exposid{length} with \tcode{n}.
60406040
\end{itemdescr}
60416041

60426042
\indexlibraryctor{counted_iterator}%
@@ -6049,8 +6049,8 @@
60496049
\begin{itemdescr}
60506050
\pnum
60516051
\effects
6052-
Initializes \tcode{current} with \tcode{x.current} and
6053-
\tcode{length} with \tcode{x.length}.
6052+
Initializes \exposid{current} with \tcode{x.\exposid{current}} and
6053+
\exposid{length} with \tcode{x.\exposid{length}}.
60546054
\end{itemdescr}
60556055

60566056
\indexlibrarymember{operator=}{counted_iterator}%
@@ -6063,8 +6063,8 @@
60636063
\begin{itemdescr}
60646064
\pnum
60656065
\effects
6066-
Assigns \tcode{x.current} to \tcode{current} and
6067-
\tcode{x.length} to \tcode{length}.
6066+
Assigns \tcode{x.\exposid{current}} to \exposid{current} and
6067+
\tcode{x.\exposid{length}} to \exposid{length}.
60686068

60696069
\pnum
60706070
\returns
@@ -6081,7 +6081,7 @@
60816081
\begin{itemdescr}
60826082
\pnum
60836083
\effects
6084-
Equivalent to: \tcode{return current;}
6084+
Equivalent to: \tcode{return \exposid{current};}
60856085
\end{itemdescr}
60866086

60876087
\indexlibrarymember{base}{counted_iterator}%
@@ -6092,7 +6092,7 @@
60926092
\begin{itemdescr}
60936093
\pnum
60946094
\returns
6095-
\tcode{std::move(current)}.
6095+
\tcode{std::move(\exposid{current})}.
60966096
\end{itemdescr}
60976097

60986098
\indexlibrarymember{count}{counted_iterator}%
@@ -6103,7 +6103,7 @@
61036103
\begin{itemdescr}
61046104
\pnum
61056105
\effects
6106-
Equivalent to: \tcode{return length;}
6106+
Equivalent to: \tcode{return \exposid{length};}
61076107
\end{itemdescr}
61086108

61096109
\rSec3[counted.iter.elem]{Element access}
@@ -6118,11 +6118,11 @@
61186118
\begin{itemdescr}
61196119
\pnum
61206120
\hardexpects
6121-
\tcode{length > 0} is \tcode{true}.
6121+
\tcode{\exposid{length} > 0} is \tcode{true}.
61226122

61236123
\pnum
61246124
\effects
6125-
Equivalent to: \tcode{return *current;}
6125+
Equivalent to: \tcode{return *\exposid{current};}
61266126
\end{itemdescr}
61276127

61286128
\indexlibrarymember{operator->}{counted_iterator}%
@@ -6134,7 +6134,7 @@
61346134
\begin{itemdescr}
61356135
\pnum
61366136
\effects
6137-
Equivalent to: \tcode{return to_address(current);}
6137+
Equivalent to: \tcode{return to_address(\exposid{current});}
61386138
\end{itemdescr}
61396139

61406140
\indexlibrarymember{operator[]}{counted_iterator}%
@@ -6150,7 +6150,7 @@
61506150

61516151
\pnum
61526152
\effects
6153-
Equivalent to: \tcode{return current[n];}
6153+
Equivalent to: \tcode{return \exposid{current}[n];}
61546154
\end{itemdescr}
61556155

61566156
\rSec3[counted.iter.nav]{Navigation}
@@ -6163,14 +6163,14 @@
61636163
\begin{itemdescr}
61646164
\pnum
61656165
\hardexpects
6166-
\tcode{length > 0} is \tcode{true}.
6166+
\tcode{\exposid{length} > 0} is \tcode{true}.
61676167

61686168
\pnum
61696169
\effects
61706170
Equivalent to:
61716171
\begin{codeblock}
6172-
++current;
6173-
--length;
6172+
++@\exposid{current}@;
6173+
--@\exposid{length}@;
61746174
return *this;
61756175
\end{codeblock}
61766176
\end{itemdescr}
@@ -6183,15 +6183,15 @@
61836183
\begin{itemdescr}
61846184
\pnum
61856185
\hardexpects
6186-
\tcode{length > 0} is \tcode{true}.
6186+
\tcode{\exposid{length} > 0} is \tcode{true}.
61876187

61886188
\pnum
61896189
\effects
61906190
Equivalent to:
61916191
\begin{codeblock}
6192-
--length;
6193-
try { return current++; }
6194-
catch(...) { ++length; throw; }
6192+
--@\exposid{length}@;
6193+
try { return @\exposid{current}@++; }
6194+
catch(...) { ++@\exposid{length}@; throw; }
61956195
\end{codeblock}
61966196
\end{itemdescr}
61976197

@@ -6223,8 +6223,8 @@
62236223
\effects
62246224
Equivalent to:
62256225
\begin{codeblock}
6226-
--current;
6227-
++length;
6226+
--@\exposid{current}@;
6227+
++@\exposid{length}@;
62286228
return *this;
62296229
\end{codeblock}
62306230
\end{itemdescr}
@@ -6255,7 +6255,7 @@
62556255
\begin{itemdescr}
62566256
\pnum
62576257
\effects
6258-
Equivalent to: \tcode{return counted_iterator(current + n, length - n);}
6258+
Equivalent to: \tcode{return counted_iterator(\exposid{current} + n, \exposid{length} - n);}
62596259
\end{itemdescr}
62606260

62616261
\indexlibrarymember{operator+}{counted_iterator}%
@@ -6280,14 +6280,14 @@
62806280
\begin{itemdescr}
62816281
\pnum
62826282
\hardexpects
6283-
\tcode{n <= length} is \tcode{true}.
6283+
\tcode{n <= \exposid{length} is \tcode{true}}.
62846284

62856285
\pnum
62866286
\effects
62876287
Equivalent to:
62886288
\begin{codeblock}
6289-
current += n;
6290-
length -= n;
6289+
@\exposid{current}@ += n;
6290+
@\exposid{length}@ -= n;
62916291
return *this;
62926292
\end{codeblock}
62936293
\end{itemdescr}
@@ -6301,7 +6301,7 @@
63016301
\begin{itemdescr}
63026302
\pnum
63036303
\effects
6304-
Equivalent to: \tcode{return counted_iterator(current - n, length + n);}
6304+
Equivalent to: \tcode{return counted_iterator(\exposid{current} - n, \exposid{length} + n);}
63056305
\end{itemdescr}
63066306

63076307
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6319,7 +6319,7 @@
63196319

63206320
\pnum
63216321
\effects
6322-
Equivalent to: \tcode{return y.length - x.length;}
6322+
Equivalent to: \tcode{return y.\exposid{length} - x.\exposid{length};}
63236323
\end{itemdescr}
63246324

63256325
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6332,7 +6332,7 @@
63326332
\pnum
63336333
\effects
63346334
Equivalent to:
6335-
\tcode{return -x.length;}
6335+
\tcode{return -x.\exposid{length};}
63366336
\end{itemdescr}
63376337

63386338
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6344,7 +6344,7 @@
63446344
\begin{itemdescr}
63456345
\pnum
63466346
\effects
6347-
Equivalent to: \tcode{return y.length;}
6347+
Equivalent to: \tcode{return y.\exposid{length};}
63486348
\end{itemdescr}
63496349

63506350
\indexlibrarymember{operator-=}{counted_iterator}%
@@ -6356,14 +6356,14 @@
63566356
\begin{itemdescr}
63576357
\pnum
63586358
\hardexpects
6359-
\tcode{-n <= length} is \tcode{true}.
6359+
\tcode{-n <= \exposid{length} is \tcode{true}}.
63606360

63616361
\pnum
63626362
\effects
63636363
Equivalent to:
63646364
\begin{codeblock}
6365-
current -= n;
6366-
length += n;
6365+
@\exposid{current}@ -= n;
6366+
@\exposid{length}@ += n;
63676367
return *this;
63686368
\end{codeblock}
63696369
\end{itemdescr}
@@ -6385,7 +6385,7 @@
63856385

63866386
\pnum
63876387
\effects
6388-
Equivalent to: \tcode{return x.length == y.length;}
6388+
Equivalent to: \tcode{return x.\exposid{length} == y.\exposid{length};}
63896389
\end{itemdescr}
63906390

63916391
\indexlibrarymember{operator==}{counted_iterator}%
@@ -6397,7 +6397,7 @@
63976397
\begin{itemdescr}
63986398
\pnum
63996399
\effects
6400-
Equivalent to: \tcode{return x.length == 0;}
6400+
Equivalent to: \tcode{return x.\exposid{length} == 0;}
64016401
\end{itemdescr}
64026402

64036403
\indexlibrarymember{operator<=>}{counted_iterator}%
@@ -6415,12 +6415,12 @@
64156415

64166416
\pnum
64176417
\effects
6418-
Equivalent to: \tcode{return y.length <=> x.length;}
6418+
Equivalent to: \tcode{return y.\exposid{length} <=> x.\exposid{length};}
64196419

64206420
\pnum
64216421
\begin{note}
64226422
The argument order in the \effects element is reversed
6423-
because \tcode{length} counts down, not up.
6423+
because \exposid{length} counts down, not up.
64246424
\end{note}
64256425
\end{itemdescr}
64266426

@@ -6430,36 +6430,36 @@
64306430
\begin{itemdecl}
64316431
friend constexpr decltype(auto)
64326432
iter_move(const counted_iterator& i)
6433-
noexcept(noexcept(ranges::iter_move(i.current)))
6433+
noexcept(noexcept(ranges::iter_move(i.@\exposid{current}@)))
64346434
requires @\libconcept{input_iterator}@<I>;
64356435
\end{itemdecl}
64366436

64376437
\begin{itemdescr}
64386438
\pnum
64396439
\hardexpects
6440-
\tcode{i.length > 0} is \tcode{true}.
6440+
\tcode{i.\exposid{length} > 0} is \tcode{true}.
64416441

64426442
\pnum
64436443
\effects
6444-
Equivalent to: \tcode{return ranges::iter_move(i.current);}
6444+
Equivalent to: \tcode{return ranges::iter_move(i.\exposid{current});}
64456445
\end{itemdescr}
64466446

64476447
\indexlibrarymember{iter_swap}{counted_iterator}%
64486448
\begin{itemdecl}
64496449
template<@\libconcept{indirectly_swappable}@<I> I2>
64506450
friend constexpr void
64516451
iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
6452-
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
6452+
noexcept(noexcept(ranges::iter_swap(x.@\exposid{current}@, y.@\exposid{current}@)));
64536453
\end{itemdecl}
64546454

64556455
\begin{itemdescr}
64566456
\pnum
64576457
\hardexpects
6458-
Both \tcode{x.length > 0} and \tcode{y.length > 0} are \tcode{true}.
6458+
Both \tcode{x.\exposid{length} > 0} and \tcode{y.\exposid{length} > 0} are \tcode{true}.
64596459

64606460
\pnum
64616461
\effects
6462-
Equivalent to \tcode{ranges::iter_swap(x.current, y.current)}.
6462+
Equivalent to \tcode{ranges::iter_swap(x.\exposid{current}, y.\exposid{current})}.
64636463
\end{itemdescr}
64646464

64656465
\rSec2[unreachable.sentinel]{Unreachable sentinel}

0 commit comments

Comments
 (0)