Boost logo

Boost :

From: Kevin S. Van Horn (Kevin.VanHorn_at_[hidden])
Date: 2002-11-11 09:59:52


I have found that

  boost::uint_t<64>::fast

gives a compiler error even on a platform (RH 7.3 on Intel) that has
64-bit integers available (as long long). On checking the documentation
again, it does specify this behavior, but this strikes me as quite
unreasonable; if a platform has long long, I should be able to use it.

I believe that all that is needed to fix this is inclusion of the
following lines:

#ifdef BOOST_HAS_LONG_LONG
  template <> struct int_least_helper<0>
  { typedef long long least; };
#endif

#ifdef BOOST_HAS_LONG_LONG
  template <> struct int_least_helper<5>
  { typedef unsigned long long least; };
#endif

Also, I'd like to see the following added to <boost/integer.hpp>:

boost::signed_int<T>::type -- Gives the signed integer type of the same
                               size as integer type T.
boost::unsigned_int<T>::type -- Gives the unsigned integer type of the
                               same size as integer type T.

Rationale: I often find myself using
  std::iterator_traits<Iterator>::difference_type
for quantities that are guaranteed to be nonnegative; for these I would
prefer to use an unsigned type.


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