Boost logo

Boost Users :

From: Jean-Francois Bastien (jfbastien_at_[hidden])
Date: 2008-03-18 12:12:10


> We have this really neat and simple macro in our project:
> #define compile_assert(x) typedef bool
> COMPILE_ASSERT[(x) ? 1 : -1]
>
> Although it does what we need and serves us well, I
> tried to replace
> it with BOOST_STATIC_ASSERT. Unfortunately this resulted
> in a lot of
> ugly warnings throughout the compile:
> warning: use of old-style cast
>

There's the following comment in the static assert header:

// Note that the argument to the assert is explicitly cast to bool using
old-
// style casts: too many compilers currently have problems with
static_cast
// when used inside integral constant expressions.

The solution would be to add even more defines to use old style or
static casts depending on which compiler is used.

JF


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