|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-06-12 08:54:15
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 );
?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk