Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 1999-08-31 10:48:09


From: Valentin Bonnard <Bonnard.V_at_[hidden]>
> ...
> I propose the following:
>
> // precondition: that debug_mode is defined
> #define BOOST_ASSERT_THROW(condition) \
> (debug_mode ? boost::Utils::assert_throw(condition, __LINE__,
> __FILE__) : 0)
>
> namespace boost {
> namespace Utils {
> struct AssertFailure : std::logic_error {
> AssertFailure (long line, const char* file);
> ...
> };
>
> inline void assert_throw (bool c, long line, const char* file)
> { if (c) throw AssertFailure (line, file); }
> }
> using namespace Utils;
> }

So any user of Boost must define exactly one extern debug_mode in
order to link?

And being a link-time constant, the code for the condition cannot
be compiled away?


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