Boost logo

Boost :

Subject: Re: [boost] [assert] Assert library? - Was: [regression] Where's boost/assert.hpp ??
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2014-02-23 18:26:06


On 23/02/14 15:29, Peter Dimov wrote:
> Mathias Gaunard wrote:
>> Apparently people prefer having plenty of different macros which have
>> non-obvious interactions with each other instead of a single macro
>> that always does what's asked.
>
> In what way do the current macros not do what's asked? What would you
> like to see instead?

Try to answer the following questions:
- what's the difference between BOOST_DISABLE_ASSERTS and NDEBUG?
- does defining BOOST_ENABLE_ASSERT_HANDLER affect whether assertions
are enabled or not?
- what's the difference between BOOST_ASSERT and BOOST_ASSERT_MSG

The answers one would expect are:
- BOOST_DISABLE_ASSERTS disables all assertions done with Boost.Assert,
while NDEBUG disables all assertions done with Boost.Assert or standard
assert.
- No, defining a handler is orthogonal to whether assertions are enabled
or not
- The only difference is that _MSG allows to define a message.

Unfortunately, none of those answers are true: defining NDEBUG does not
disable BOOST_ASSERT (but it does disable BOOST_ASSERT_MSG -- nice
inconsistency) if BOOST_ENABLE_ASSERT_HANDLER is set.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk