On Wednesday, 1 March 2023 17:04:39 PST Edward Catmur via Std-Proposals wrote:
> I'm not entirely sure that size_t can't promote to
> int, although obviously it doesn't on any sensible platform.
It's possible. Integer promotion rules say that only types of rank lesser than
int can promote to int and only so long as all the values of that integer fit
int, otherwise they promote to unsigned. Therefore, you'd need to find a
sizeof(size_t) < sizeof(int)
That is permitted, but I don't think exists or has ever existed.
It exists, I had to fix libstdc++ for it recently:
(I mistakenly said I32LP16 in that commit msg but should have said something like I32LL64P16, better obviously long can't be smaller than int, but size_t can be unsigned short).