Created on 2024-12-13.00:00:00 last changed 3 days ago
[ 2025-02-07; Reflector poll ]
Set priority to 3 after reflector poll.
"The behaviour for Ranges regressed due to LWG 3403. It might have been a mistake to broaden the domain of `ranges::ssize` to match that of `ranges::size`. The latter includes some non-Range arguments to ease the transition from `std::size`, but thjere was no existing body of pre-C++20 code calling `std::ssize` that needed a transition path."
There exist range types `R` whose size is representable by neither `ptrdiff_t` nor make-signed-like-t<ranges::range_size_t<R>>, specifically `views::iota(size_t(0), size_t(-1))`. It's unfortunate that `std::ssize` and `ranges::ssize` produce a negative size for such ranges even when their difference type is capable of representing their size (see demo). Perhaps the `ssize` overloads should return static_cast<common_type_t<ptrdiff_t, iter_difference_t<decltype(meow.begin())>>>(meow.size()) instead when the argument meow models `range`?
History | |||
---|---|---|---|
Date | User | Action | Args |
2025-02-07 20:50:56 | admin | set | messages: + msg14592 |
2024-12-13 00:00:00 | admin | create |