size_t + ptrdiff_t

Manu turkeyman at gmail.com
Sun Feb 19 06:59:05 PST 2012


Okay, so it came up a couple of times, but the questions is, what are we
going to do about it?

size_t and ptrdiff_t are incomplete, and represent non-complimentary
signed/unsigned halves of the requirement.
There are TWO types needed, register size, and pointer size. Currently,
these are assumed to be the same, which is a false assumption.

I propose size_t + ssize_t should both exist, and represent the native
integer size. Also something like ptr_t, and ptrdiff_t should also exist,
and represent the size of the pointer.

Personally, I don't like the _t notation at all. It doesn't fit the rest of
the D types, but it's established, so I don't expect it can change. But we
do need the 2 missing types.

There is also the problem that there is lots of code written using the
incorrect types. Some time needs to be taken to correct phobos too I guess.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120219/5c99c9bd/attachment.html>


More information about the Digitalmars-d mailing list