Size_t on x86 is uint,on x64 is ulong,it's a good thing?

monarch_dodra via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 17 22:54:03 PDT 2014


On Friday, 18 April 2014 at 00:31:20 UTC, FrankLIKE wrote:
> Thank you,I think 'use uint' is better than 'use ulong' .
> You know that 'point.x,point.y' is int ,on x64 ,no change,
> 'length' keeps the same to 'point.x,point.y' ,maybe a good 
> thing.
>
> Frank.

You are only supposed to use `size_t` (and `ptrdiff_t`) for 
things that represent pointer indexing, pointer offsets, or their 
genral abstractions (indexing a slice, getting the length of a 
range...).

If you want to store "just a number", then select an integral 
type with pre-defined size.


More information about the Digitalmars-d mailing list