Skip to content

Commit 3c295e4

Browse files
[iterators.counted] Exposition-only style for current and length
1 parent ca4dad4 commit 3c295e4

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
@@ -5989,15 +5989,15 @@
59895989
const counted_iterator& x, const counted_iterator<I2>& y);
59905990

59915991
friend constexpr decltype(auto) iter_move(const counted_iterator& i)
5992-
noexcept(noexcept(ranges::iter_move(i.current)))
5992+
noexcept(noexcept(ranges::iter_move(i.@\exposid{current}@)))
59935993
requires @\libconcept{input_iterator}@<I>;
59945994
template<@\libconcept{indirectly_swappable}@<I> I2>
59955995
friend constexpr void iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
5996-
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
5996+
noexcept(noexcept(ranges::iter_swap(x.@\exposid{current}@, y.@\exposid{current}@)));
59975997

59985998
private:
5999-
I current = I(); // \expos
6000-
iter_difference_t<I> length = 0; // \expos
5999+
I @\exposid{current}@ = I(); // \expos
6000+
iter_difference_t<I> @\exposid{length}@ = 0; // \expos
60016001
};
60026002

60036003
template<@\libconcept{input_iterator}@ I>
@@ -6023,8 +6023,8 @@
60236023

60246024
\pnum
60256025
\effects
6026-
Initializes \tcode{current} with \tcode{std::move(i)} and
6027-
\tcode{length} with \tcode{n}.
6026+
Initializes \exposid{current} with \tcode{std::move(i)} and
6027+
\exposid{length} with \tcode{n}.
60286028
\end{itemdescr}
60296029

60306030
\indexlibraryctor{counted_iterator}%
@@ -6037,8 +6037,8 @@
60376037
\begin{itemdescr}
60386038
\pnum
60396039
\effects
6040-
Initializes \tcode{current} with \tcode{x.current} and
6041-
\tcode{length} with \tcode{x.length}.
6040+
Initializes \exposid{current} with \tcode{x.\exposid{current}} and
6041+
\exposid{length} with \tcode{x.\exposid{length}}.
60426042
\end{itemdescr}
60436043

60446044
\indexlibrarymember{operator=}{counted_iterator}%
@@ -6051,8 +6051,8 @@
60516051
\begin{itemdescr}
60526052
\pnum
60536053
\effects
6054-
Assigns \tcode{x.current} to \tcode{current} and
6055-
\tcode{x.length} to \tcode{length}.
6054+
Assigns \tcode{x.\exposid{current}} to \exposid{current} and
6055+
\tcode{x.\exposid{length}} to \exposid{length}.
60566056

60576057
\pnum
60586058
\returns
@@ -6069,7 +6069,7 @@
60696069
\begin{itemdescr}
60706070
\pnum
60716071
\effects
6072-
Equivalent to: \tcode{return current;}
6072+
Equivalent to: \tcode{return \exposid{current};}
60736073
\end{itemdescr}
60746074

60756075
\indexlibrarymember{base}{counted_iterator}%
@@ -6080,7 +6080,7 @@
60806080
\begin{itemdescr}
60816081
\pnum
60826082
\returns
6083-
\tcode{std::move(current)}.
6083+
\tcode{std::move(\exposid{current})}.
60846084
\end{itemdescr}
60856085

60866086
\indexlibrarymember{count}{counted_iterator}%
@@ -6091,7 +6091,7 @@
60916091
\begin{itemdescr}
60926092
\pnum
60936093
\effects
6094-
Equivalent to: \tcode{return length;}
6094+
Equivalent to: \tcode{return \exposid{length};}
60956095
\end{itemdescr}
60966096

60976097
\rSec3[counted.iter.elem]{Element access}
@@ -6106,11 +6106,11 @@
61066106
\begin{itemdescr}
61076107
\pnum
61086108
\hardexpects
6109-
\tcode{length > 0} is \tcode{true}.
6109+
\tcode{\exposid{length} > 0} is \tcode{true}.
61106110

61116111
\pnum
61126112
\effects
6113-
Equivalent to: \tcode{return *current;}
6113+
Equivalent to: \tcode{return *\exposid{current};}
61146114
\end{itemdescr}
61156115

61166116
\indexlibrarymember{operator->}{counted_iterator}%
@@ -6122,7 +6122,7 @@
61226122
\begin{itemdescr}
61236123
\pnum
61246124
\effects
6125-
Equivalent to: \tcode{return to_address(current);}
6125+
Equivalent to: \tcode{return to_address(\exposid{current});}
61266126
\end{itemdescr}
61276127

61286128
\indexlibrarymember{operator[]}{counted_iterator}%
@@ -6138,7 +6138,7 @@
61386138

61396139
\pnum
61406140
\effects
6141-
Equivalent to: \tcode{return current[n];}
6141+
Equivalent to: \tcode{return \exposid{current}[n];}
61426142
\end{itemdescr}
61436143

61446144
\rSec3[counted.iter.nav]{Navigation}
@@ -6151,14 +6151,14 @@
61516151
\begin{itemdescr}
61526152
\pnum
61536153
\hardexpects
6154-
\tcode{length > 0} is \tcode{true}.
6154+
\tcode{\exposid{length} > 0} is \tcode{true}.
61556155

61566156
\pnum
61576157
\effects
61586158
Equivalent to:
61596159
\begin{codeblock}
6160-
++current;
6161-
--length;
6160+
++@\exposid{current}@;
6161+
--@\exposid{length}@;
61626162
return *this;
61636163
\end{codeblock}
61646164
\end{itemdescr}
@@ -6171,15 +6171,15 @@
61716171
\begin{itemdescr}
61726172
\pnum
61736173
\hardexpects
6174-
\tcode{length > 0} is \tcode{true}.
6174+
\tcode{\exposid{length} > 0} is \tcode{true}.
61756175

61766176
\pnum
61776177
\effects
61786178
Equivalent to:
61796179
\begin{codeblock}
6180-
--length;
6181-
try { return current++; }
6182-
catch(...) { ++length; throw; }
6180+
--@\exposid{length}@;
6181+
try { return @\exposid{current}@++; }
6182+
catch(...) { ++@\exposid{length}@; throw; }
61836183
\end{codeblock}
61846184
\end{itemdescr}
61856185

@@ -6211,8 +6211,8 @@
62116211
\effects
62126212
Equivalent to:
62136213
\begin{codeblock}
6214-
--current;
6215-
++length;
6214+
--@\exposid{current}@;
6215+
++@\exposid{length}@;
62166216
return *this;
62176217
\end{codeblock}
62186218
\end{itemdescr}
@@ -6243,7 +6243,7 @@
62436243
\begin{itemdescr}
62446244
\pnum
62456245
\effects
6246-
Equivalent to: \tcode{return counted_iterator(current + n, length - n);}
6246+
Equivalent to: \tcode{return counted_iterator(\exposid{current} + n, \exposid{length} - n);}
62476247
\end{itemdescr}
62486248

62496249
\indexlibrarymember{operator+}{counted_iterator}%
@@ -6268,14 +6268,14 @@
62686268
\begin{itemdescr}
62696269
\pnum
62706270
\hardexpects
6271-
\tcode{n <= length} is \tcode{true}.
6271+
\tcode{n <= \exposid{length} is \tcode{true}}.
62726272

62736273
\pnum
62746274
\effects
62756275
Equivalent to:
62766276
\begin{codeblock}
6277-
current += n;
6278-
length -= n;
6277+
@\exposid{current}@ += n;
6278+
@\exposid{length}@ -= n;
62796279
return *this;
62806280
\end{codeblock}
62816281
\end{itemdescr}
@@ -6289,7 +6289,7 @@
62896289
\begin{itemdescr}
62906290
\pnum
62916291
\effects
6292-
Equivalent to: \tcode{return counted_iterator(current - n, length + n);}
6292+
Equivalent to: \tcode{return counted_iterator(\exposid{current} - n, \exposid{length} + n);}
62936293
\end{itemdescr}
62946294

62956295
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6307,7 +6307,7 @@
63076307

63086308
\pnum
63096309
\effects
6310-
Equivalent to: \tcode{return y.length - x.length;}
6310+
Equivalent to: \tcode{return y.\exposid{length} - x.\exposid{length};}
63116311
\end{itemdescr}
63126312

63136313
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6320,7 +6320,7 @@
63206320
\pnum
63216321
\effects
63226322
Equivalent to:
6323-
\tcode{return -x.length;}
6323+
\tcode{return -x.\exposid{length};}
63246324
\end{itemdescr}
63256325

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

63386338
\indexlibrarymember{operator-=}{counted_iterator}%
@@ -6344,14 +6344,14 @@
63446344
\begin{itemdescr}
63456345
\pnum
63466346
\hardexpects
6347-
\tcode{-n <= length} is \tcode{true}.
6347+
\tcode{-n <= \exposid{length} is \tcode{true}}.
63486348

63496349
\pnum
63506350
\effects
63516351
Equivalent to:
63526352
\begin{codeblock}
6353-
current -= n;
6354-
length += n;
6353+
@\exposid{current}@ -= n;
6354+
@\exposid{length}@ += n;
63556355
return *this;
63566356
\end{codeblock}
63576357
\end{itemdescr}
@@ -6373,7 +6373,7 @@
63736373

63746374
\pnum
63756375
\effects
6376-
Equivalent to: \tcode{return x.length == y.length;}
6376+
Equivalent to: \tcode{return x.\exposid{length} == y.\exposid{length};}
63776377
\end{itemdescr}
63786378

63796379
\indexlibrarymember{operator==}{counted_iterator}%
@@ -6385,7 +6385,7 @@
63856385
\begin{itemdescr}
63866386
\pnum
63876387
\effects
6388-
Equivalent to: \tcode{return x.length == 0;}
6388+
Equivalent to: \tcode{return x.\exposid{length} == 0;}
63896389
\end{itemdescr}
63906390

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

64046404
\pnum
64056405
\effects
6406-
Equivalent to: \tcode{return y.length <=> x.length;}
6406+
Equivalent to: \tcode{return y.\exposid{length} <=> x.\exposid{length};}
64076407

64086408
\pnum
64096409
\begin{note}
64106410
The argument order in the \effects element is reversed
6411-
because \tcode{length} counts down, not up.
6411+
because \exposid{length} counts down, not up.
64126412
\end{note}
64136413
\end{itemdescr}
64146414

@@ -6418,36 +6418,36 @@
64186418
\begin{itemdecl}
64196419
friend constexpr decltype(auto)
64206420
iter_move(const counted_iterator& i)
6421-
noexcept(noexcept(ranges::iter_move(i.current)))
6421+
noexcept(noexcept(ranges::iter_move(i.@\exposid{current}@)))
64226422
requires @\libconcept{input_iterator}@<I>;
64236423
\end{itemdecl}
64246424

64256425
\begin{itemdescr}
64266426
\pnum
64276427
\hardexpects
6428-
\tcode{i.length > 0} is \tcode{true}.
6428+
\tcode{i.\exposid{length} > 0} is \tcode{true}.
64296429

64306430
\pnum
64316431
\effects
6432-
Equivalent to: \tcode{return ranges::iter_move(i.current);}
6432+
Equivalent to: \tcode{return ranges::iter_move(i.\exposid{current});}
64336433
\end{itemdescr}
64346434

64356435
\indexlibrarymember{iter_swap}{counted_iterator}%
64366436
\begin{itemdecl}
64376437
template<@\libconcept{indirectly_swappable}@<I> I2>
64386438
friend constexpr void
64396439
iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
6440-
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
6440+
noexcept(noexcept(ranges::iter_swap(x.@\exposid{current}@, y.@\exposid{current}@)));
64416441
\end{itemdecl}
64426442

64436443
\begin{itemdescr}
64446444
\pnum
64456445
\hardexpects
6446-
Both \tcode{x.length > 0} and \tcode{y.length > 0} are \tcode{true}.
6446+
Both \tcode{x.\exposid{length} > 0} and \tcode{y.\exposid{length} > 0} are \tcode{true}.
64476447

64486448
\pnum
64496449
\effects
6450-
Equivalent to \tcode{ranges::iter_swap(x.current, y.current)}.
6450+
Equivalent to \tcode{ranges::iter_swap(x.\exposid{current}, y.\exposid{current})}.
64516451
\end{itemdescr}
64526452

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

0 commit comments

Comments
 (0)