Boost logo

Boost :

Subject: Re: [boost] [config] polygon library long long, long double portability
From: John Maddock (john_at_[hidden])
Date: 2009-06-26 04:23:33


>> msvc has 64 bit ints, but doesn't call them long long.

Yes it does, at least with current versions :-)

>>
> Yes, I realized that long double must be standard after grepping the boost
> codebase and seeing it used everywhere. If we searched the archive we'd
> probably find I asked this same question in the past. I might be a slow
> learner. My code with long long compiles in MSVC, does is compile to a 32
> bit int? Specifying int64_t would make sense if my integer coordinate
> traits were in terms of int32_t, but they are in terms of int. Perhaps I
> should change that as well.

Please don't confuse types, with widths: you need to use either specific
width types throughout (which are all of unspecified type), or use specific
types. For example code that needs to overload a function for all the
integer *types* would use long long where available, where as code that's
designed to work with specific *widths* should use the boost::intXX_t types
throughout, in the knowledge that these may not cover all the available
*types* (for example if long is a 64-bit int then long long is never used by
the intXX_t typedefs).

I hope that's not too confusing :-) Basically decide which set to used
based on what your code does, and what the integers represent.

HTH, John.


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