Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-01-28 06:45:15


>BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_integer ||
>RandomAccessIteratorConcept<T>::value);

Dave, I meant to get back to you on the static-assertion problem you had -
basically I tried all sorts of things, and with VC6
std::numeric_limits<T>::is_integer seems to always evaluate to false at
compile time: the following also fails:

template <class T>
struct int_check1
{
        typedef int (&type)[std::numeric_limits<T>::is_specialized ? 1 :
-1];
};
int_check1<int> ic1;

Strangely the problem seems to be unique to numeric_limits - the boost
type_traits classes always seem to give the right answer when fed into
static assertions. At the moment I have no idea what's going on.

- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/


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