Boost logo

Boost :

From: Dirk Gerrits (dirk_at_[hidden])
Date: 2003-03-11 15:55:14


Gennaro Prota wrote:
> On Tue, 11 Mar 2003 17:46:17 +0100, Dirk Gerrits
> <dirk_at_[hidden]> wrote:
>
>
>
>>Perhaps I missed a part of the discussion, but what is wrong with Jaap's
>>suggestion:
>>
>>#ifdef BOOST_STATIC_NDEBUG
>> #define BOOST_STATIC_ASSERT( B ) BOOST_STATIC_ASSERT_IMPL( true )
>>#else
>> #define BOOST_STATIC_ASSERT( B ) BOOST_STATIC_ASSERT_IMPL( B )
>>#endif
>>
>>?
>
>
> Well, considering that what we want is just a no-op, which do you
> prefer?
>
> a) typedef ::boost::static_assert_test<
> sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( true ) >)>
> BOOST_JOIN(boost_static_assert_typedef_, __LINE__);
>
> (I've just picked up one of the implementations in static_assert.hpp,
> but the others don't differ too much.)
>
>
> b) typedef void boost_static_assert_typedef;

The effect is the same.

However, (a) or BOOST_STATIC_ASSERT_IMPL( true ) avoids all of the
(potential?) problems you are worrying about. So why do you prefer (b)?

Regards,

Dirk Gerrits


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