Boost logo

Boost :

From: me22 (me22.ca_at_[hidden])
Date: 2006-06-13 12:34:29


With the endian discussion, I looked at Boost.Integer to try to figure
out why it didn't support long long and __int64 where possible. Since
I couldn't see a reason why it didn't, I went ahead and implemented
it.

The only major interface change is adding additional ValueUpper
template parameters to int_(max|min)_value_t and uint_value_t. They
default to 0, so no valid old code should be affected. They allow the
programmer to use, for example, uint_value_t<0x34567890,0x12> to
request a type that can hold 0x1234567890 or
int_min_value_t<-0x34567890,-0x12> to request a type that can hold
-0x1234567890, which will properly fail if there are no types
available over 32 bits (instead of just truncating the constant and
giving the wrong result).

I also took the opportunity to add int_exact_t templates for cases
where an exact number of bits is needed. int_exact_t<32>::exact, for
example.

If this looks good I'll try to decipher the macros in the test suite
to add some new ones. The changes don't cause any regressions from
integer_test.cpp under my g++ 3.3.6, 3.4.6, or 4.1.1. In keeping with
the rationale and noticing that it works just about all the compilers,
I used no partial specialisation or recursion, so I'm hoping that
it'll work fine in the more troublesome compilers as well.
Unfortunately portage tell me that gcc-2* is to old to work with the
rest of my system, so I haven't been able to try.

~ Scott McMurray




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