
18 Jan
2011
18 Jan
'11
11:58 a.m.
Den 17-01-2011 16:06, Beman Dawes skrev:
Whenever I write a BOOST_ASSERT macro, I'm envious of C++0x static_assert because of its ability to supply a clear error message. I'd really like to be able to write a variant of BOOST_ASSERT like this:
#include<boost/assert.hpp> int main() { BOOST_EXTENDED_ASSERT(true, "This will not assert"); BOOST_EXTENDED_ASSERT(false, "This will assert"); return 0; }
I'm fine with BOOST_ASSERT_MSG(). Since we are adding assert.hpp I would like to see BOOST_ASSERT_IF() BOOST_ASSERT_IF_MSG() as well. It is really much clearer to read and maintain than BOOST_ASSERT( !foo() || condition ); -Thorsten