]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Implement LWG 3403 for std::ranges::ssize
authorJonathan Wakely <jwakely@redhat.com>
Fri, 4 Jun 2021 19:28:04 +0000 (20:28 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 4 Jun 2021 20:33:59 +0000 (21:33 +0100)
commit621ea10ca060ba19ec693aa73b5e29d553cca849
treec6e6597462a2efb9f5c72357b4ac701e97e1bb9a
parent3e5f2425f80aedd00f28235022a2755eb46f310d
libstdc++: Implement LWG 3403 for std::ranges::ssize

I already changed the constraints for ranges::ssize to use ranges::size,
this implements the rest of LWG 3403, so that the returned type is the
signed type corresponding to the result of ranges::size.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/ranges_base.h (_SSize): Return the result of
ranges::size converted to the wider of make-signed-like-t<S> and
ptrdiff_t, rather than the ranges different type.
* testsuite/std/ranges/access/ssize.cc: Adjust expected result
for an iota_view that uses an integer class type for its
difference_type.
libstdc++-v3/include/bits/ranges_base.h
libstdc++-v3/testsuite/std/ranges/access/ssize.cc