Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-05-15 17:48:11


Rene Rivera wrote:
> That should be 14.7.1 :-) I've added a test to static_assert to see if
> other compilers have this problem.
>
> This failure only worries me because it's likely hiding either a bunch
> of other failures, or successes. So if anyone has some idea on how to
> make a macro generate different code based on function or non-function
> context I would _love_ to know.

Aha, fixed it!!

There is now a custom version of static_assert for CW-8.x:

// special version for CodeWarrior <= 8.x
#define BOOST_STATIC_ASSERT( B ) \
    BOOST_STATIC_CONSTANT(int, \
      BOOST_JOIN(boost_static_assert_test_, __LINE__) = \
        sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) )

Which, for example, translates to:

static const int boost_static_assert_test_10 =
sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( N < 2 ) >) ;

This forces the template instantiation on both function and non-function
context. So for the first time all static_assert tests pass for this
compiler :-) -- And this should also clear all the Spirit tests.

Enjoy.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

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