size_t for length on x64 will make app slower than on x86?

FrankLike via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 18 04:22:58 PST 2014


>> I mean projects moved from x86 to x64, 'cast(int)length ' is 
>> better than 'size_t i=(something).length '.
>
> I think the reason for the existence of size_t, is that the C 
> designers thought that the second way is better than the first 
> way.

But now 'int' is enough, not huge and  not small.

if you do this:

   string[] a ={"abc","def","ghk"... };//Assuming a's length is 
1,000,000

  for(int i=0;i<a.length;i++)
   {
   	somework();
   }

it's enough! 'int' easy to write,not Waste.

Most important is easy to migrate code from x86 to x64.


More information about the Digitalmars-d mailing list