size_t + ptrdiff_t

Manu turkeyman at
Sun Feb 19 09:51:27 PST 2012

On 19 February 2012 19:26, Stewart Gordon <smjg_1998 at> wrote:

> On 19/02/2012 17:04, Manu wrote:
> <snip>
>>    Indeed, how does code rely on the concept of native int at all?
>> You can't imagine any situation where you might want to know how big an
>> int is?
> <snip>
> Hang on ... are we talking here about some "native int", or the int type?
> If you want to know the size of a "native int", I think you would need to
> know more about how the particular machine works internally in order to
> take advantage of it.

In many cases you wouldn't need to know anything other than that.

I don't really understand your resistance? I'm going to have the type when
I need it, the question is, will it be standardised, or will I (& everyone
else) invent the name and introduce a block of (probably not very portable)
version() bullshit at the top of their module?
Almost nobody here puts any thought towards portability, or any
architecture other than x86+linux. I don't trust individuals writing their
own version mess to define it correctly in their libraries... or to do it
at all for that matter, they'll just be writing less portable code.

Try this: Build phobos for x64, but define size_t as 32bits, and see what
happens. You'll see what I'm talking about.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Digitalmars-d mailing list