Boost logo

Boost :

From: Michael Stevens (michael_at_[hidden])
Date: 2002-10-16 01:18:10

Hi everyone,

Jens has been making a few changes to Boost random recently. These
include a lot of additional static asserts such as


The wrapper should disable the assert for nasty compilers. However...

VC7 seems to have a bizare problem with these. The macro is not define,
because in the normal case the compile time constants do work. However
if the limits type parameter is a template parameter they don't work.
This little example shows the problem.

// Test VC7 Limit
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>

BOOST_STATIC_ASSERT(std::numeric_limits<int>::is_integer); // OK

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

Any ideas?

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