Boost logo

Boost :

Subject: Re: [boost] [utility] [assert] Proposal for a new assert macro which stores the failed values ("informative assert")
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-06-07 06:36:13


On Friday 07 June 2013 12:16:49 Krzysztof Czainski wrote:
>
> So should there be a guideline to use the BOOST_ASSERT( expr || !"msg" )
> idiom instead of BOOST_ASSERT_MSG, when msg is only a string literal, or
> how should this problem be addressed?

IMHO, BOOST_ASSERT_MSG should be optimized, and this is possible to do while
keeping the current interface. If
boost::assertion::detail::assertion_failed_msg is defined to be never inlined,
and the checked condition is marked so that it is unlikely to be true, then
this would solve the problems I mentioned. This will probably require adding
BOOST_NOINLINE and BOOST_LIKELY/BOOST_UNLIKELY macros to Boost.Config though.

I can do this a bit later, if noone objects.


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