If ptrdiff_t
were unsigned, it would be able to refer to twice as many elements. On my machine PTRDIFF_MAX
is expanded to 9223372036854775807i64
, whereas ULLONG_MAX
is 18446744073709551615Ui64
.
I know that these values are huge themselves, but if
The type (
ptrdiff_t
)'s size is chosen so that it can store the maximum size of a theoretically possible array of any type.
then doesn't making it unsigned make more sense?