Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 1999-08-06 10:38:05

The C++ Standard Library <limits> header supplies a class template
numeric_limits<>, and requires specializations for each fundamental

For integer types, the interesting members of numeric_limits<> are:

   static const bool is_specialized; // will be true for integers
   static T min() throw();
   static T max() throw();
   static const int digits; // for integers, # value bits
   static const int digits10;
   static const bool is_signed;
   static const bool is_integer; // will be true for integers

For many uses, these are sufficient. But min() and max() are
problems because they are not constant expressions (5.19) and some
uses require constant expressions.

Valentin worked around this by providing an extended_numeric_limits<>
class derived from numeric_limits<>, which for integers added:

   static const T max_constant;
   static const T min_constant;

(I have changed lots of details from Valentin's header for the sake
of exposition.)

Now the 64-bit question:

   Is it worthwhile for boost to supply an extended_numeric_limits<>

To me, it seems more trouble that it is worth. What do others think?


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