> > That's right. But if this will ever get into boost maybe we'll better > use the classical do-while(0). Borland warns on if(false), and > assert(false) is quite common, for instance, in the default case of > switch statements. BOOST_INVARIANT(false) could be used similarly > (Though, depending on the people who would speak in the formal review, > we could choose to have a separate macro for 'assert always'-like > cases, with no condition argument) >
Unfortunately, we can't use the do-while(0) idiom, since we don't know when while(0) will be ;-) Example: BOOST_ASSERT(i != j)(i)(j); or BOOST_ASSERT(i > 1000)(i); note: see the 'smart assert' thread, where we discuss details about the interface/ implementation of the smart assert (BOOST_ASSERT) Best, John _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost