Boost logo

Boost :

Subject: [boost] [integer] Bug in int_t<65>
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-02-23 17:17:04


I was trying to instantiate a boost::int_t<65>::least and I didn't got
an error. Unfortunately the size of the obtained type was 8.

I think that there is an error in the meta-function class as there is a
comparison without and with the sign bit in // **

   template< int Bits > // bits (including sign) required
   struct int_t : public detail::exact_signed_base_helper<Bits>
       typedef typename detail::int_least_helper
           (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT))
+ // **
            1 +

The same applies to uint_t.

The fix of course consists in checking

           (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) +
// **

Please could this be fixed in trunk?


Boost list run by bdawes at, gregod at, cpdaniel at, john at