Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-10-16 07:49:42


Michael Stevens <michael_at_[hidden]> writes:

>
> template <class IntType>
> class fred
> {
> static const bool x = std::numeric_limits<IntType>::is_integer;
> BOOST_STATIC_ASSERT(std::numeric_limits<int>::is_integer); // OK
> BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer); //
> FAILS on definition of template!
> };
>
>
> This little beauty is stoping the current random implementation from
> compiling. Obvious solution is to enable
> BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS for VC7.
>
> Any ideas?

You could try:

   BOOST_STATIC_CONSTANT(bool, x = std::numeric_limits<IntType>::is_integer);
   BOOST_STATIC_ASSERT(x);

You could also try forcing x to be an enum, if BOOST_STATIC_CONSTANT
isn't already configured that way for vc7.

shot-in-the-dark-ly y'rs,
dave

-- 
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com

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