Gennaro Prota wrote:
On Tue, 11 Mar 2003 17:46:17 +0100, Dirk Gerrits
<[EMAIL PROTECTED]> 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


_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to