Re: Moving from C++ to VC++
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Mon, 13 Jun 2005 13:59:01 -0500
On Mon, 13 Jun 2005 19:24:17 +0200, Bo Persson wrote:
> No, now you are making the assumptions. :-)
Rubber, meet glue. :)
> Using __int64 just means that int and long wasn't enough, because
> someone decided to keep them 32 bit, even when the machine grew. So now
> __int64 is a rather large integer, just like long once was. It doesn't
> say that I wanted exactly 64 bits.
Regardless of what you wanted, __int64 means exactly "64 bit integer". You
can't seriously think everyone who uses it would prefer a 4096 bit integer
if only it were available.
> It definitely doesn't say that 64
> bits will still be okay when we get machines with 96 or 128 or whatever
> bits. We just get yet another long type problem!
Sure, if you're using __int64 to mean the longest integer available, you'll
have that problem.
> But some of had expected the type long to be, like a kind of long type.
> Something to use when int just isn't enough.
The thing is, that's been an invalid assumption for the last 20 years of 32
bit machines.
> Something the implementor
> would make big enough when the system changed.
So you _do_ want to use it non-portably. Why not make your code more
predictable as well and acknowledge the data type decisions you think
you're avoiding by using long?
> So you expect __int64 to grow when we need an even larger index type?
> :-)
No, but I expect the code that used it for a 64 bit type to remain valid
much more so than if it had used long, and the size of long was changed.
--
Doug Harrison
Microsoft MVP - Visual C++
.
- Follow-Ups:
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- References:
- Moving from C++ to VC++
- From: NoName
- Re: Moving from C++ to VC++
- From: Severian [MVP]
- Re: Moving from C++ to VC++
- From: Victor Bazarov
- Re: Moving from C++ to VC++
- From: Carl Daniel [VC++ MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Carl Daniel [VC++ MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Doug Harrison [MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Doug Harrison [MVP]
- Re: Moving from C++ to VC++
- From: Hendrik Schober
- Re: Moving from C++ to VC++
- From: Doug Harrison [MVP]
- Re: Moving from C++ to VC++
- From: Bo Persson
- Re: Moving from C++ to VC++
- From: Doug Harrison [MVP]
- Re: Moving from C++ to VC++
- From: Bo Persson
- Moving from C++ to VC++
- Prev by Date: Re: Rational Purify detects memory leaks in function SHFileOperation()
- Next by Date: Problems with formatted input.
- Previous by thread: Re: Moving from C++ to VC++
- Next by thread: Re: Moving from C++ to VC++
- Index(es):
Relevant Pages
|
Loading