diff --git a/source/iterators.tex b/source/iterators.tex index ce9786e65a..9bdf8656da 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1319,20 +1319,10 @@ template inline constexpr bool @\exposid{is-signed-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos - -template - concept @\deflibconcept{weakly_incrementable}@ = - @\libconcept{movable}@ && - requires(I i) { - typename iter_difference_t; - requires @\exposid{is-signed-integer-like}@>; - { ++i } -> @\libconcept{same_as}@; // not required to be equality-preserving - i++; // not required to be equality-preserving - }; \end{codeblock} \pnum -A type \tcode{I} is an \defnadj{integer-class}{type} +A type \tcode{T} is an \defnadj{integer-class}{type} if it is in a set of \impldef{integer-class type} types that behave as integer types do, as defined below. \begin{note} @@ -1354,22 +1344,22 @@ that of every integral type of the same signedness. \pnum -A type \tcode{I} other than \cv{}~\tcode{bool} is \defn{integer-like} -if it models \tcode{\libconcept{integral}} or +A type \tcode{T} other than \cv{}~\tcode{bool} is \defn{integer-like} +if it models \tcode{\libconcept{integral}} or if it is an integer-class type. -An integer-like type \tcode{I} is \defn{signed-integer-like} -if it models \tcode{\libconcept{signed_integral}} or +An integer-like type \tcode{T} is \defn{signed-integer-like} +if it models \tcode{\libconcept{signed_integral}} or if it is a signed-integer-class type. -An integer-like type \tcode{I} is \defn{unsigned-integer-like} -if it models \tcode{\libconcept{unsigned_integral}} or +An integer-like type \tcode{T} is \defn{unsigned-integer-like} +if it models \tcode{\libconcept{unsigned_integral}} or if it is an unsigned-integer-class type. \pnum -For every integer-class type \tcode{I}, -let \tcode{B(I)} be a unique hypothetical extended integer type -of the same signedness with the same width\iref{basic.fundamental} as \tcode{I}. +For every integer-class type \tcode{T}, +let \tcode{B(T)} be a unique hypothetical extended integer type +of the same signedness with the same width\iref{basic.fundamental} as \tcode{T}. \begin{note} -The corresponding hypothetical specialization \tcode{numeric_limits} +The corresponding hypothetical specialization \tcode{numeric_limits} meets the requirements on \tcode{numeric_limits} specializations for integral types\iref{numeric.limits}. \end{note} @@ -1389,16 +1379,16 @@ where $N$ is the width of the destination type. \pnum -Let \tcode{a} be an object of integer-class type \tcode{I}, -let \tcode{b} be an object of integer-like type \tcode{I2} -such that the expression \tcode{b} is implicitly convertible to \tcode{I}, +Let \tcode{a} be an object of integer-class type \tcode{T}, +let \tcode{b} be an object of integer-like type \tcode{T2} +such that the expression \tcode{b} is implicitly convertible to \tcode{T}, let \tcode{x} and \tcode{y} be, respectively, -objects of type \tcode{B(I)} and \tcode{B(I2)} as described above +objects of type \tcode{B(T)} and \tcode{B(T2)} as described above that represent the same values as \tcode{a} and \tcode{b}, and let \tcode{c} be an lvalue of any integral type. \begin{itemize} \item -The expressions \tcode{a++} and \tcode{a--} shall be prvalues of type \tcode{I} +The expressions \tcode{a++} and \tcode{a--} shall be prvalues of type \tcode{T} whose values are equal to that of \tcode{a} prior to the evaluation of the expressions. The expression \tcode{a++} shall modify the value of \tcode{a} @@ -1414,7 +1404,7 @@ is well-formed, \tcode{@a} shall also be well-formed and have the same value, effects, and value category as \tcode{@x}. If \tcode{@x} has type \tcode{bool}, so too does \tcode{@a}; - if \tcode{@x} has type \tcode{B(I)}, then \tcode{@a} has type \tcode{I}. + if \tcode{@x} has type \tcode{B(T)}, then \tcode{@a} has type \tcode{T}. \item For every assignment operator \tcode{@=} for which \tcode{c @= x} is well-formed, @@ -1435,18 +1425,18 @@ \tcode{a @ b} and \tcode{b @ a} shall also be well-formed and shall have the same value, effects, and value category as \tcode{x @ y} and \tcode{y @ x}, respectively. - If \tcode{x @ y} or \tcode{y @ x} has type \tcode{B(I)}, - then \tcode{a @ b} or \tcode{b @ a}, respectively, has type \tcode{I}; - if \tcode{x @ y} or \tcode{y @ x} has type \tcode{B(I2)}, - then \tcode{a @ b} or \tcode{b @ a}, respectively, has type \tcode{I2}; + If \tcode{x @ y} or \tcode{y @ x} has type \tcode{B(T)}, + then \tcode{a @ b} or \tcode{b @ a}, respectively, has type \tcode{T}; + if \tcode{x @ y} or \tcode{y @ x} has type \tcode{B(T2)}, + then \tcode{a @ b} or \tcode{b @ a}, respectively, has type \tcode{T2}; if \tcode{x @ y} or \tcode{y @ x} has any other type, then \tcode{a @ b} or \tcode{b @ a}, respectively, has that type. \end{itemize} \pnum -An expression \tcode{E} of integer-class type \tcode{I} is +An expression \tcode{E} of integer-class type \tcode{T} is contextually convertible to \tcode{bool} -as if by \tcode{bool(E != I(0))}. +as if by \tcode{bool(E != T(0))}. \pnum All integer-class types model @@ -1457,36 +1447,47 @@ A value-initialized object of integer-class type has value 0. \pnum -For every (possibly cv-qualified) integer-class type \tcode{I}, -\tcode{numeric_limits} is specialized such that +For every (possibly cv-qualified) integer-class type \tcode{T}, +\tcode{numeric_limits} is specialized such that each static data member \tcode{m} -has the same value as \tcode{numeric_limits::m}, and +has the same value as \tcode{numeric_limits::m}, and each static member function \tcode{f} -returns \tcode{I(numeric_limits::f())}. +returns \tcode{T(numeric_limits::f())}. \pnum -For any two integer-like types \tcode{I1} and \tcode{I2}, +For any two integer-like types \tcode{T1} and \tcode{T2}, at least one of which is an integer-class type, -\tcode{common_type_t} denotes an integer-class type -whose width is not less than that of \tcode{I1} or \tcode{I2}. -If both \tcode{I1} and \tcode{I2} are signed-integer-like types, -then \tcode{common_type_t} is also a signed-integer-like type. +\tcode{common_type_t} denotes an integer-class type +whose width is not less than that of \tcode{T1} or \tcode{T2}. +If both \tcode{T1} and \tcode{T2} are signed-integer-like types, +then \tcode{common_type_t} is also a signed-integer-like type. \pnum -For any two integer-like types \tcode{I1} and \tcode{I2}, +For any two integer-like types \tcode{T1} and \tcode{T2}, at least one of which is an integer-class type, -\tcode{common_type_t} denotes an integer-like type -whose width is not less than that of \tcode{I1} or \tcode{I2}. -If both \tcode{I1} and \tcode{I2} are signed-integer-like types, -then \tcode{common_type_t} is also a signed-integer-like type. +\tcode{common_type_t} denotes an integer-like type +whose width is not less than that of \tcode{T1} or \tcode{T2}. +If both \tcode{T1} and \tcode{T2} are signed-integer-like types, +then \tcode{common_type_t} is also a signed-integer-like type. \pnum -\tcode{\exposid{is-integer-like}} is \tcode{true} -if and only if \tcode{I} is an integer-like type. -\tcode{\exposid{is-signed-integer-like}} is \tcode{true} -if and only if \tcode{I} is a signed-integer-like type. +\tcode{\exposid{is-integer-like}} is \tcode{true} +if and only if \tcode{T} is an integer-like type. +\tcode{\exposid{is-signed-integer-like}} is \tcode{true} +if and only if \tcode{T} is a signed-integer-like type. \pnum +\begin{codeblock} +template + concept @\deflibconcept{weakly_incrementable}@ = + @\libconcept{movable}@ && + requires(I i) { + typename iter_difference_t; + requires @\exposid{is-signed-integer-like}@>; + { ++i } -> @\libconcept{same_as}@; // not required to be equality-preserving + i++; // not required to be equality-preserving + }; +\end{codeblock} Let \tcode{i} be an object of type \tcode{I}. When \tcode{i} is in the domain of both pre- and post-increment, \tcode{i} is said to be \defn{incrementable}. \tcode{I} models \tcode{\libconcept{weakly_incrementable}} only if 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