Boost logo

Boost Users :

From: Stephen Torri (torrisa_at_[hidden])
Date: 2008-02-01 12:15:26


Is there a way to detect a unsigned integer? I would like to have a
template to replace a macro that checks a value is in a range. Here is
what I have so far:

      template <typename Limit_Type>
        static inline void in_range ( boost::uint32_t value, Limit_Type limit )
        {
          if ( value > limit )
            {
              throw errors::Internal_Exception ( errors::Internal_Exception::INVALID_VALUE );
            }
          }

I would like to replace the "boost::uint32_t" with a default typename
and check to see if the 'value' is an unsigned type.

Stephen


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net