
18 Jan
2011
18 Jan
'11
5:06 p.m.
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 ) is. -Thorsten