
On Mon, Jan 17, 2011 at 10:42 AM, Eric Niebler <eric@boostpro.com> wrote:
On 1/17/2011 10:24 PM, Robert Kawulak wrote:
From: Beman Dawes BOOST_EXTENDED_ASSERT(true, "This will not assert"); BOOST_EXTENDED_ASSERT(false, "This will assert");
+1, although I hate the name - it's too long. The use of asserts should be encouraged by making them fast to type and cluttering the code as little as possible. Right now I can't think of any obviously good name, but maybe BOOST_ASSERTM (assert with message)?
It should be BOOST_ASSERT_MSG, just as MPL has BOOST_MPL_ASSERT_MSG.
Ha! Much better! Thanks!
And +1 to Dean's suggestion of std::abort.
Yeah, that's better if I can only figure out how to stop the [expletive deleted] Windows dialog boxes.
And also, can we find a better option than writing to std::cerr?
I really don't like std::cerr either, because it doesn't interleave correctly with cout on VC++ builds. What about changing to std::cout as the default of all of <boost/assert.hpp>, but with a configuration macro available to override the default?
And lastly, just as with BOOST_ASSERT, there should be a way to hook it to install your own failed-assertion handler.
Yeah, I assumed that, but didn't want to bother with it unless the basic idea of BOOST_ASSERT_MSG() flies.
That is all. :-)
Much help,
Thanks, --Beman