Skip to content

Commit f72b033

Browse files
committed
[iterator.concept.winc] Move concept definition near its description
Also rename the placeholder type I to T, used in the specification of the exposition-only concepts is-integer-like and is-signed-integer-like, to avoid a presentation conflict with the placeholder type I referring to an iterator type.
1 parent 930dd54 commit f72b033

File tree

1 file changed

+46
-44
lines changed

1 file changed

+46
-44
lines changed

source/iterators.tex

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,20 +1312,10 @@
13121312

13131313
template<class T>
13141314
inline constexpr bool @\exposid{is-signed-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos
1315-
1316-
template<class I>
1317-
concept @\deflibconcept{weakly_incrementable}@ =
1318-
@\libconcept{default_initializable}@<I> && @\libconcept{movable}@<I> &&
1319-
requires(I i) {
1320-
typename iter_difference_t<I>;
1321-
requires @\exposid{is-signed-integer-like}@<iter_difference_t<I>>;
1322-
{ ++i } -> @\libconcept{same_as}@<I&>; // not required to be equality-preserving
1323-
i++; // not required to be equality-preserving
1324-
};
13251315
\end{codeblock}
13261316

13271317
\pnum
1328-
A type \tcode{I} is an \defnadj{integer-class}{type}
1318+
A type \tcode{T} is an \defnadj{integer-class}{type}
13291319
if it is in a set of \impldef{integer-class type} class types
13301320
that behave as integer types do, as defined below.
13311321

@@ -1338,25 +1328,25 @@
13381328
otherwise, it is an \defnadj{unsigned-integer-class}{type}.
13391329

13401330
\pnum
1341-
For every integer-class type \tcode{I},
1342-
let \tcode{B(I)} be a hypothetical extended integer type
1331+
For every integer-class type \tcode{T},
1332+
let \tcode{B(T)} be a hypothetical extended integer type
13431333
of the same signedness with the smallest width\iref{basic.fundamental}
13441334
capable of representing the same range of values.
1345-
The width of \tcode{I} is equal to the width of \tcode{B(I)}.
1335+
The width of \tcode{T} is equal to the width of \tcode{B(T)}.
13461336

13471337
\pnum
1348-
Let \tcode{a} and \tcode{b} be objects of integer-class type \tcode{I},
1349-
let \tcode{x} and \tcode{y} be objects of type \tcode{B(I)} as described above
1338+
Let \tcode{a} and \tcode{b} be objects of integer-class type \tcode{T},
1339+
let \tcode{x} and \tcode{y} be objects of type \tcode{B(T)} as described above
13501340
that represent the same values as \tcode{a} and \tcode{b} respectively, and
13511341
let \tcode{c} be an lvalue of any integral type.
13521342
\begin{itemize}
13531343
\item
13541344
For every unary operator \tcode{@} for which the expression \tcode{@x}
13551345
is well-formed, \tcode{@a} shall also be well-formed
13561346
and have the same value, effects, and value category as \tcode{@x}
1357-
provided that value is representable by \tcode{I}.
1347+
provided that value is representable by \tcode{T}.
13581348
If \tcode{@x} has type \tcode{bool}, so too does \tcode{@a};
1359-
if \tcode{@x} has type \tcode{B(I)}, then \tcode{@a} has type \tcode{I}.
1349+
if \tcode{@x} has type \tcode{B(T)}, then \tcode{@a} has type \tcode{T}.
13601350
\item
13611351
For every assignment operator \tcode{@=}
13621352
for which \tcode{c @= x} is well-formed,
@@ -1367,9 +1357,9 @@
13671357
For every binary operator \tcode{@} for which \tcode{x @ y} is well-formed,
13681358
\tcode{a @ b} shall also be well-formed and
13691359
shall have the same value, effects, and value category as \tcode{x @ y}
1370-
provided that value is representable by \tcode{I}.
1360+
provided that value is representable by \tcode{T}.
13711361
If \tcode{x @ y} has type \tcode{bool}, so too does \tcode{a @ b};
1372-
if \tcode{x @ y} has type \tcode{B(I)}, then \tcode{a @ b} has type \tcode{I}.
1362+
if \tcode{x @ y} has type \tcode{B(T)}, then \tcode{a @ b} has type \tcode{T}.
13731363
\end{itemize}
13741364

13751365
\pnum
@@ -1381,9 +1371,9 @@
13811371
do not exit via an exception.
13821372

13831373
\pnum
1384-
An expression \tcode{E} of integer-class type \tcode{I} is
1374+
An expression \tcode{E} of integer-class type \tcode{T} is
13851375
contextually convertible to \tcode{bool}
1386-
as if by \tcode{bool(E != I(0))}.
1376+
as if by \tcode{bool(E != T(0))}.
13871377

13881378
\pnum
13891379
All integer-class types model
@@ -1394,44 +1384,56 @@
13941384
A value-initialized object of integer-class type has value 0.
13951385

13961386
\pnum
1397-
For every (possibly cv-qualified) integer-class type \tcode{I},
1398-
\tcode{numeric_limits<I>} is specialized such that:
1387+
For every (possibly cv-qualified) integer-class type \tcode{T},
1388+
\tcode{numeric_limits<T>} is specialized such that:
13991389
\begin{itemize}
14001390
\item
1401-
\tcode{numeric_limits<I>::is_specialized} is \tcode{true},
1391+
\tcode{numeric_limits<T>::is_specialized} is \tcode{true},
14021392
\item
1403-
\tcode{numeric_limits<I>::is_signed} is \tcode{true}
1404-
if and only if \tcode{I} is a signed-integer-class type,
1393+
\tcode{numeric_limits<T>::is_signed} is \tcode{true}
1394+
if and only if \tcode{T} is a signed-integer-class type,
14051395
\item
1406-
\tcode{numeric_limits<I>::is_integer} is \tcode{true},
1396+
\tcode{numeric_limits<T>::is_integer} is \tcode{true},
14071397
\item
1408-
\tcode{numeric_limits<I>::is_exact} is \tcode{true},
1398+
\tcode{numeric_limits<T>::is_exact} is \tcode{true},
14091399
\item
1410-
\tcode{numeric_limits<I>::digits} is equal to the width of the integer-class type,
1400+
\tcode{numeric_limits<T>::digits} is equal to the width of the integer-class type,
14111401
\item
1412-
\tcode{numeric_limits<I>::digits10} is equal to \tcode{static_cast<int>(digits * log10(2))}, and
1402+
\tcode{numeric_limits<T>::digits10} is equal to \tcode{static_cast<int>(digits * log10(2))}, and
14131403
\item
1414-
\tcode{numeric_limits<I>::min()} and \tcode{numeric_limits<I>::max()} return
1415-
the lowest and highest representable values of \tcode{I}, respectively, and
1416-
\tcode{numeric_limits<I>::lowest()} returns \tcode{numeric_limits<I>::\brk{}min()}.
1404+
\tcode{numeric_limits<T>::min()} and \tcode{numeric_limits<T>::max()} return
1405+
the lowest and highest representable values of \tcode{T}, respectively, and
1406+
\tcode{numeric_limits<T>::lowest()} returns \tcode{numeric_limits<T>::\brk{}min()}.
14171407
\end{itemize}
14181408

14191409
\pnum
1420-
A type \tcode{I} other than \cv{}~\tcode{bool} is \defn{integer-like}
1421-
if it models \tcode{\libconcept{integral}<I>} or
1410+
A type \tcode{T} other than \cv{}~\tcode{bool} is \defn{integer-like}
1411+
if it models \tcode{\libconcept{integral}<T>} or
14221412
if it is an integer-class type.
1423-
An integer-like type \tcode{I} is \defn{signed-integer-like}
1424-
if it models \tcode{\libconcept{signed_integral}<I>} or
1413+
An integer-like type \tcode{T} is \defn{signed-integer-like}
1414+
if it models \tcode{\libconcept{signed_integral}<T>} or
14251415
if it is a signed-integer-class type.
1426-
An integer-like type \tcode{I} is \defn{unsigned-integer-like}
1427-
if it models \tcode{\libconcept{unsigned_integral}<I>} or
1416+
An integer-like type \tcode{T} is \defn{unsigned-integer-like}
1417+
if it models \tcode{\libconcept{unsigned_integral}<T>} or
14281418
if it is an unsigned-integer-class type.
14291419

14301420
\pnum
1431-
\tcode{\exposid{is-integer-like}<I>} is \tcode{true}
1432-
if and only if \tcode{I} is an integer-like type.
1433-
\tcode{\exposid{is-signed-integer-like}<I>} is \tcode{true}
1434-
if and only if \tcode{I} is a signed-integer-like type.
1421+
\tcode{\exposid{is-integer-like}<T>} is \tcode{true}
1422+
if and only if \tcode{T} is an integer-like type.
1423+
\tcode{\exposid{is-signed-integer-like}<T>} is \tcode{true}
1424+
if and only if \tcode{T} is a signed-integer-like type.
1425+
1426+
\begin{codeblock}
1427+
template<class I>
1428+
concept @\deflibconcept{weakly_incrementable}@ =
1429+
@\libconcept{default_initializable}@<I> && @\libconcept{movable}@<I> &&
1430+
requires(I i) {
1431+
typename iter_difference_t<I>;
1432+
requires @\exposid{is-signed-integer-like}@<iter_difference_t<I>>;
1433+
{ ++i } -> @\libconcept{same_as}@<I&>; // not required to be equality-preserving
1434+
i++; // not required to be equality-preserving
1435+
};
1436+
\end{codeblock}
14351437

14361438
\pnum
14371439
Let \tcode{i} be an object of type \tcode{I}. When \tcode{i} is in the domain of

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy