Make size_t its own type

Dukc ajieskola at gmail.com
Tue Jan 28 12:51:56 UTC 2025


On Thursday, 23 January 2025 at 16:00:20 UTC, Quirin Schroll 
wrote:
> The title says it: Make `size_t` be a type that’s distinguished 
> from all currently existing unsigned types.
>
> [snip]

Everything you wrote applies to `ptrdiff_t` too, of course. 
`size_t` and `ptrdiff_t` should implicitly convert to each other 
since they're always the same size (as long as we allow implicit 
signed/unsigned conversions in general).

I like the idea per se, but it's going to be lot of breakage. At 
minimum it needs an edition switch, and even then it might be too 
much. I think it should be implemented experimentally first to 
see how much code would break.


More information about the dip.ideas mailing list