Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2002-10-19 16:35:07


On Sat, 19 Oct 2002 17:12:48 +0200, Eric Woodruff wrote:

> You're right, that macro is not very intuitive, as most aren't. It could
> be throwing an unlisted exception or causing the function to "return;" !
>
> Or it just may call abort. It also may only do this if _DEBUG is
> defined.
>
> Maybe it says: if (!(px != 0)) px = 1;

Whatever it does, I think the user should have a chance to request a
defined behaviour. This is essential to create robust applications, as
they are never free of bugs. Maybe a traits-class could be used? I don't
know if there is a general boost policy for this topic, but ASSERT could
be customized by the user (and depending on the compiler/environment) to
do:

- Nothing (assuming asserts never fail :)
- throw an exception
- write a msg to cerr and abortimmediately
- call some user-defined function (maybe useful in MT applications)

The current situation ("undefined behaviour") is IMHO far from good -
it's just a very easy (lazy?) approach ;))

Regards, Daniel


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