File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =' 1.0' encoding =' utf-8' standalone =' no' ?>
2+ <!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+ <issue num =" 4181" status =" New" >
5+ <title >Some ranges have negative `ssize`</title >
6+ <section ><sref ref =" [iterator.range]" /><sref ref =" [range.prim.ssize]" /></section >
7+ <submitter >Casey Carter</submitter >
8+ <date >13 Dec 2024</date >
9+ <priority >99</priority >
10+
11+ <discussion >
12+ <p >
13+ There exist range types `R` whose size is representable by neither `ptrdiff_t` nor
14+ <tt ><i >make-signed-like-t</i >< ranges::range_size_t< R>> </tt >, specifically `views::iota(size_t(0), size_t(-1))`.
15+ It's unfortunate that `std::ssize` and `ranges::ssize` produce a negative size for such ranges even when their
16+ difference type is capable of representing their size (see <a href =" https://www.godbolt.org/z/599z55Y4f" >demo</a >).
17+ Perhaps the `ssize` overloads should return
18+ <tt >static_cast< common_type_t< ptrdiff_t, iter_difference_t< decltype(<i >meow</i >.begin())>>> (<i >meow</i >.size())</tt >
19+ instead when the argument <tt ><i >meow</i ></tt > models `range`?
20+ </p >
21+ </discussion >
22+
23+ <resolution >
24+ </resolution >
25+
26+ </issue >
You can’t perform that action at this time.
0 commit comments