Boost logo

Boost :

Subject: Re: [boost] [polygon] compiled in MSVC8 successfully, but boost::long_long_type gives runtime errors.
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2009-07-07 18:41:30


Steven Watanabe wrote:

>> In MSVC8 BOOST_HAS_LONG_LONG is defined and I'm using the
>> boost::long_long_type the way it was suggested that I should.
>>
>
> I don't think this is related to the use of long long since the
> following program works okay.
>
> #include <iostream>
>
> int main() {
> long long x = 1.0;
> double d = x;
> std::cout << x << std::endl;
> }
>

It turns out that I was using boost::long_long_type, and when I changed that typedef to long long the problem goes away.

I remember you mentioned this to me a while back:

> You might also consider using boost::int64_t from
> boost/cstdint.hpp guarded by BOOST_NO_INT64_T
>
> msvc has 64 bit ints, but doesn't call them long long.

I checked sizeof(long long) in my MSVC8 environment and it was 8 bytes, so I think I'm happy to use it.

Do you know what data type boost::long_long_type was using?

I ought to be able to check in a version of the code sometime tomorrow that works in MSVC8,9, gcc 3.2.2 and later, and icc9 and later.

Thanks,
Luke


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk