Skip to content

Commit e100bd2

Browse files
[iterators.counted] Exposition-only style for current and length
1 parent 013a5e2 commit e100bd2

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
@@ -5987,15 +5987,15 @@
59875987
const counted_iterator& x, const counted_iterator<I2>& y);
59885988

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

59965996
private:
5997-
I current = I(); // \expos
5998-
iter_difference_t<I> length = 0; // \expos
5997+
I @\exposid{current}@ = I(); // \expos
5998+
iter_difference_t<I> @\exposid{length}@ = 0; // \expos
59995999
};
60006000

60016001
template<@\libconcept{input_iterator}@ I>
@@ -6021,8 +6021,8 @@
60216021

60226022
\pnum
60236023
\effects
6024-
Initializes \tcode{current} with \tcode{std::move(i)} and
6025-
\tcode{length} with \tcode{n}.
6024+
Initializes \exposid{current} with \tcode{std::move(i)} and
6025+
\exposid{length} with \tcode{n}.
60266026
\end{itemdescr}
60276027

60286028
\indexlibraryctor{counted_iterator}%
@@ -6035,8 +6035,8 @@
60356035
\begin{itemdescr}
60366036
\pnum
60376037
\effects
6038-
Initializes \tcode{current} with \tcode{x.current} and
6039-
\tcode{length} with \tcode{x.length}.
6038+
Initializes \exposid{current} with \tcode{x.\exposid{current}} and
6039+
\exposid{length} with \tcode{x.\exposid{length}}.
60406040
\end{itemdescr}
60416041

60426042
\indexlibrarymember{operator=}{counted_iterator}%
@@ -6049,8 +6049,8 @@
60496049
\begin{itemdescr}
60506050
\pnum
60516051
\effects
6052-
Assigns \tcode{x.current} to \tcode{current} and
6053-
\tcode{x.length} to \tcode{length}.
6052+
Assigns \tcode{x.\exposid{current}} to \exposid{current} and
6053+
\tcode{x.\exposid{length}} to \exposid{length}.
60546054

60556055
\pnum
60566056
\returns
@@ -6067,7 +6067,7 @@
60676067
\begin{itemdescr}
60686068
\pnum
60696069
\effects
6070-
Equivalent to: \tcode{return current;}
6070+
Equivalent to: \tcode{return \exposid{current};}
60716071
\end{itemdescr}
60726072

60736073
\indexlibrarymember{base}{counted_iterator}%
@@ -6078,7 +6078,7 @@
60786078
\begin{itemdescr}
60796079
\pnum
60806080
\returns
6081-
\tcode{std::move(current)}.
6081+
\tcode{std::move(\exposid{current})}.
60826082
\end{itemdescr}
60836083

60846084
\indexlibrarymember{count}{counted_iterator}%
@@ -6089,7 +6089,7 @@
60896089
\begin{itemdescr}
60906090
\pnum
60916091
\effects
6092-
Equivalent to: \tcode{return length;}
6092+
Equivalent to: \tcode{return \exposid{length};}
60936093
\end{itemdescr}
60946094

60956095
\rSec3[counted.iter.elem]{Element access}
@@ -6104,11 +6104,11 @@
61046104
\begin{itemdescr}
61056105
\pnum
61066106
\hardexpects
6107-
\tcode{length > 0} is \tcode{true}.
6107+
\tcode{\exposid{length} > 0} is \tcode{true}.
61086108

61096109
\pnum
61106110
\effects
6111-
Equivalent to: \tcode{return *current;}
6111+
Equivalent to: \tcode{return *\exposid{current};}
61126112
\end{itemdescr}
61136113

61146114
\indexlibrarymember{operator->}{counted_iterator}%
@@ -6120,7 +6120,7 @@
61206120
\begin{itemdescr}
61216121
\pnum
61226122
\effects
6123-
Equivalent to: \tcode{return to_address(current);}
6123+
Equivalent to: \tcode{return to_address(\exposid{current});}
61246124
\end{itemdescr}
61256125

61266126
\indexlibrarymember{operator[]}{counted_iterator}%
@@ -6136,7 +6136,7 @@
61366136

61376137
\pnum
61386138
\effects
6139-
Equivalent to: \tcode{return current[n];}
6139+
Equivalent to: \tcode{return \exposid{current}[n];}
61406140
\end{itemdescr}
61416141

61426142
\rSec3[counted.iter.nav]{Navigation}
@@ -6149,14 +6149,14 @@
61496149
\begin{itemdescr}
61506150
\pnum
61516151
\hardexpects
6152-
\tcode{length > 0} is \tcode{true}.
6152+
\tcode{\exposid{length} > 0} is \tcode{true}.
61536153

61546154
\pnum
61556155
\effects
61566156
Equivalent to:
61576157
\begin{codeblock}
6158-
++current;
6159-
--length;
6158+
++@\exposid{current}@;
6159+
--@\exposid{length}@;
61606160
return *this;
61616161
\end{codeblock}
61626162
\end{itemdescr}
@@ -6169,15 +6169,15 @@
61696169
\begin{itemdescr}
61706170
\pnum
61716171
\hardexpects
6172-
\tcode{length > 0} is \tcode{true}.
6172+
\tcode{\exposid{length} > 0} is \tcode{true}.
61736173

61746174
\pnum
61756175
\effects
61766176
Equivalent to:
61776177
\begin{codeblock}
6178-
--length;
6179-
try { return current++; }
6180-
catch(...) { ++length; throw; }
6178+
--@\exposid{length}@;
6179+
try { return @\exposid{current}@++; }
6180+
catch(...) { ++@\exposid{length}@; throw; }
61816181
\end{codeblock}
61826182
\end{itemdescr}
61836183

@@ -6209,8 +6209,8 @@
62096209
\effects
62106210
Equivalent to:
62116211
\begin{codeblock}
6212-
--current;
6213-
++length;
6212+
--@\exposid{current}@;
6213+
++@\exposid{length}@;
62146214
return *this;
62156215
\end{codeblock}
62166216
\end{itemdescr}
@@ -6241,7 +6241,7 @@
62416241
\begin{itemdescr}
62426242
\pnum
62436243
\effects
6244-
Equivalent to: \tcode{return counted_iterator(current + n, length - n);}
6244+
Equivalent to: \tcode{return counted_iterator(\exposid{current} + n, \exposid{length} - n);}
62456245
\end{itemdescr}
62466246

62476247
\indexlibrarymember{operator+}{counted_iterator}%
@@ -6266,14 +6266,14 @@
62666266
\begin{itemdescr}
62676267
\pnum
62686268
\hardexpects
6269-
\tcode{n <= length} is \tcode{true}.
6269+
\tcode{n <= \exposid{length} is \tcode{true}}.
62706270

62716271
\pnum
62726272
\effects
62736273
Equivalent to:
62746274
\begin{codeblock}
6275-
current += n;
6276-
length -= n;
6275+
@\exposid{current}@ += n;
6276+
@\exposid{length}@ -= n;
62776277
return *this;
62786278
\end{codeblock}
62796279
\end{itemdescr}
@@ -6287,7 +6287,7 @@
62876287
\begin{itemdescr}
62886288
\pnum
62896289
\effects
6290-
Equivalent to: \tcode{return counted_iterator(current - n, length + n);}
6290+
Equivalent to: \tcode{return counted_iterator(\exposid{current} - n, \exposid{length} + n);}
62916291
\end{itemdescr}
62926292

62936293
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6305,7 +6305,7 @@
63056305

63066306
\pnum
63076307
\effects
6308-
Equivalent to: \tcode{return y.length - x.length;}
6308+
Equivalent to: \tcode{return y.\exposid{length} - x.\exposid{length};}
63096309
\end{itemdescr}
63106310

63116311
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6318,7 +6318,7 @@
63186318
\pnum
63196319
\effects
63206320
Equivalent to:
6321-
\tcode{return -x.length;}
6321+
\tcode{return -x.\exposid{length};}
63226322
\end{itemdescr}
63236323

63246324
\indexlibrarymember{operator-}{counted_iterator}%
@@ -6330,7 +6330,7 @@
63306330
\begin{itemdescr}
63316331
\pnum
63326332
\effects
6333-
Equivalent to: \tcode{return y.length;}
6333+
Equivalent to: \tcode{return y.\exposid{length};}
63346334
\end{itemdescr}
63356335

63366336
\indexlibrarymember{operator-=}{counted_iterator}%
@@ -6342,14 +6342,14 @@
63426342
\begin{itemdescr}
63436343
\pnum
63446344
\hardexpects
6345-
\tcode{-n <= length} is \tcode{true}.
6345+
\tcode{-n <= \exposid{length} is \tcode{true}}.
63466346

63476347
\pnum
63486348
\effects
63496349
Equivalent to:
63506350
\begin{codeblock}
6351-
current -= n;
6352-
length += n;
6351+
@\exposid{current}@ -= n;
6352+
@\exposid{length}@ += n;
63536353
return *this;
63546354
\end{codeblock}
63556355
\end{itemdescr}
@@ -6371,7 +6371,7 @@
63716371

63726372
\pnum
63736373
\effects
6374-
Equivalent to: \tcode{return x.length == y.length;}
6374+
Equivalent to: \tcode{return x.\exposid{length} == y.\exposid{length};}
63756375
\end{itemdescr}
63766376

63776377
\indexlibrarymember{operator==}{counted_iterator}%
@@ -6383,7 +6383,7 @@
63836383
\begin{itemdescr}
63846384
\pnum
63856385
\effects
6386-
Equivalent to: \tcode{return x.length == 0;}
6386+
Equivalent to: \tcode{return x.\exposid{length} == 0;}
63876387
\end{itemdescr}
63886388

63896389
\indexlibrarymember{operator<=>}{counted_iterator}%
@@ -6401,12 +6401,12 @@
64016401

64026402
\pnum
64036403
\effects
6404-
Equivalent to: \tcode{return y.length <=> x.length;}
6404+
Equivalent to: \tcode{return y.\exposid{length} <=> x.\exposid{length};}
64056405

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

@@ -6416,36 +6416,36 @@
64166416
\begin{itemdecl}
64176417
friend constexpr decltype(auto)
64186418
iter_move(const counted_iterator& i)
6419-
noexcept(noexcept(ranges::iter_move(i.current)))
6419+
noexcept(noexcept(ranges::iter_move(i.@\exposid{current}@)))
64206420
requires @\libconcept{input_iterator}@<I>;
64216421
\end{itemdecl}
64226422

64236423
\begin{itemdescr}
64246424
\pnum
64256425
\hardexpects
6426-
\tcode{i.length > 0} is \tcode{true}.
6426+
\tcode{i.\exposid{length} > 0} is \tcode{true}.
64276427

64286428
\pnum
64296429
\effects
6430-
Equivalent to: \tcode{return ranges::iter_move(i.current);}
6430+
Equivalent to: \tcode{return ranges::iter_move(i.\exposid{current});}
64316431
\end{itemdescr}
64326432

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

64416441
\begin{itemdescr}
64426442
\pnum
64436443
\hardexpects
6444-
Both \tcode{x.length > 0} and \tcode{y.length > 0} are \tcode{true}.
6444+
Both \tcode{x.\exposid{length} > 0} and \tcode{y.\exposid{length} > 0} are \tcode{true}.
64456445

64466446
\pnum
64476447
\effects
6448-
Equivalent to \tcode{ranges::iter_swap(x.current, y.current)}.
6448+
Equivalent to \tcode{ranges::iter_swap(x.\exposid{current}, y.\exposid{current})}.
64496449
\end{itemdescr}
64506450

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

0 commit comments

Comments
 (0)