Peter Dimov wrote:
The reason I used a ?: operator is to make BOOST_ASSERT an expression. It's supposed to be a drop-in replacement for assert, and I think that assert expands an expression and not a statement.
I can't think of any reason to use assert as an expression. But you're right, you might as well give BOOST_ASSERT the same behavior.
Maybe we ought to decorate assertion_failed with __attribute__((noreturn))? Or replace the call to assertion_failed with (assertion_failed(...), abort())?
They both seem to work. :-) I guess the __attribute__ technique would be nicest. But it's a GCC extension. Does this problem exist with other compilers at all? If so, perhaps they could benefit from using the abort method instead. I don't have any experience with other compilers. -- Michiel Helvensteijn