
AMDG On 1/18/2011 9:06 AM, Thorsten Ottosen wrote:
Den 18-01-2011 16:39, Stewart, Robert skrev:
Perhaps you mean that condition can be used to suppress certain assertions (and not others) without, itself, appearing in the assertion message? I've never done that, so the value is low for me, but perhaps there are good use cases I've overlooked.
If you mean something else entirely, please clarify.
It's to avoid writing
BOOST_ASSERT( !foo() || assertion )
which in priciple is identical to
if( foo() ) BOOST_ASSERT( assertion )
but which is not guaranteed to be removed by the compiler, whereas
BOOST_ASSERT_IF( foo(), assertion )
What exactly is wrong with BOOST_ASSERT( !foo() || assertion ) or BOOST_ASSERT( foo() ? assertion : true ) IMHO, the last thing we need is lots of minor variations that don't add any real utility. In Christ, Steven Watanabe