libstdc++: P1970R2 Consistency for size() functions: Add ranges::ssize
authorJonathan Wakely <jwakely@redhat.com>
Mon, 17 Feb 2020 17:58:09 +0000 (17:58 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 17 Feb 2020 18:15:41 +0000 (18:15 +0000)
commit7ab36231a17d8a78f4355289ebbd9d32bb8ede7b
tree1c419defbfddea3d2ff7785a335518b88ef130c5
parent9866abe31ec47f493ff40f525ad970bb60906c4b
libstdc++: P1970R2 Consistency for size() functions: Add ranges::ssize

This defines ranges::ssize as approved in Prague. It's unclear what is
supposed to happen for types for which range_difference_t is not a valid
type. I've assumed they are not meant to be usable with ranges::ssize,
despite being usable with ranges::size.

* include/bits/range_access.h (_SSize, ssize): Define for C++20.
* testsuite/std/ranges/access/ssize.cc: New test.
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/range_access.h
libstdc++-v3/testsuite/std/ranges/access/ssize.cc [new file with mode: 0644]