18 Mar
2008
18 Mar
'08
4:12 p.m.
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