Skip to content

Commit fd8fd77

Browse files
burblebeetkoeppe
authored andcommitted
LWG3403 Domain of ranges::ssize(E) doesn't match ranges::size(E)
1 parent 5fa2546 commit fd8fd77

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

source/ranges.tex

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,13 @@
330330
\tcode{x} explicitly converted to
331331
\tcode{\placeholdernc{make-unsigned-like-t}<X>}.
332332

333+
\pnum
334+
Also within this Clause,
335+
\tcode{\exposid{make-signed-like-t}<X>} for an integer-like type \tcode{X}
336+
denotes \tcode{make_signed_t<X>} if \tcode{X} is an integer type;
337+
otherwise, it denotes a corresponding unspecified signed-integer-like type
338+
of the same width as \tcode{X}.
339+
333340
\rSec1[range.access]{Range access}
334341

335342
\rSec2[range.access.general]{General}
@@ -790,19 +797,17 @@
790797
\pnum
791798
The name \tcode{ranges::ssize} denotes
792799
a customization point object\iref{customization.point.object}.
793-
The expression \tcode{ranges::ssize(\brk{}E)}
794-
for a subexpression \tcode{E} of type \tcode{T}
795-
is expression-equivalent to:
796-
797-
\begin{itemize}
798-
\item
799-
If \tcode{range_difference_t<T>} has width less than \tcode{ptrdiff_t},
800-
\tcode{static_cast<ptrdiff_t>(ranges::\linebreak{}size(E))}.
801800

802-
\item
803-
Otherwise,
804-
\tcode{static_cast<range_difference_t<T>>(ranges::size(E))}.
805-
\end{itemize}
801+
\pnum
802+
Given a subexpression \tcode{E} with type \tcode{T},
803+
let \tcode{t} be an lvalue that denotes the reified object for \tcode{E}.
804+
If \tcode{ranges::size(t)} is ill-formed,
805+
\tcode{ranges::ssize(E)} is ill-formed.
806+
Otherwise let \tcode{D} be
807+
\tcode{\exposid{make-signed-like-t}<decltype(ranges::\brk{}size(t))>}, or
808+
\tcode{ptrdiff_t} if it is wider than that type;
809+
\tcode{ranges::ssize(E)} is expression-equivalent to
810+
\tcode{static_cast<D>(ranges::size(t))}.
806811

807812
\rSec2[range.prim.empty]{\tcode{ranges::empty}}
808813
\indexlibraryglobal{empty}%

0 commit comments

Comments
 (0)