Boost logo

Boost :

Subject: Re: [boost] [assert] static_assert envy
From: Eric Niebler (eric_at_[hidden])
Date: 2011-01-17 10:42:35

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. And
+1 to Dean's suggestion of std::abort. And also, can we find a better
option than writing to std::cerr? And lastly, just as with BOOST_ASSERT,
there should be a way to hook it to install your own failed-assertion
handler. That is all. :-)

Eric Niebler
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at