Subject: Re: [boost] [utility] [assert] Proposal for a new assert macro which stores the failed values ("informative assert")
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2013-06-05 14:44:18
2013/6/5 Andrey Semashev <andrey.semashev_at_[hidden]>
> I would very much prefer BOOST_ASSERT to stay as small and lightweight as
> possible and equivalent to the standard assert macro by default. One
> we're not using BOOST_ASSERT_MSG much is that it uses streaming expressions
> to format the error message, which turns out to be too heavy in some places
> (e.g. it prevents small functions from inlining and fragments the hot code
> too much). Please, make a new macro for this feature.
I second the problem with BOOST_ASSERT_MSG. And I'm thinking it can be
trivially worked around: BOOST_ASSERT_MSG could be (conditionally) defined
#define BOOST_ASSERT_MSG( expr, msg ) assert( (expr) || !msg )
Does this look like a good idea?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk