
12 Jun
2008
12 Jun
'08
12:54 p.m.
Thorsten Ottosen:
Dear all,
I often find myself in the need of the above assertion mechanism where the actual assertion should only checked if the first condition is true.
Of course, we could write this as
if( IF ) BOOST_ASSERT( THEN );
but this has the potential downside that the compiler cannot completely optimize away the function calls inside the if-statement.
BOOST_ASSERT( !IF || THEN ); or BOOST_ASSERT( IF? THEN: true ); ?