Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-11-12 08:54:53

From: "Toon Knapen" <toon.knapen_at_[hidden]>
> Peter Dimov wrote:
> > See the code at the end for my proposed implementation of BOOST_ASSERT.
> >
> > Design goals:
> >
> > * Simple;

> On C99 compatible compilers you can also indicate the function in which
> the assert occured using __func__ (in addition to __LINE__ and __FILE__)
> (e.g. gcc-2.95.x and newer do this in their assert)
> Ideally would also be to have a stacktrace-dump when an assert occurs
> (and the user would want this). The only way I see to do this is to
> insert in debug-mode a small object in every function which is going to
> register the function in a stack in some singleton (using __func__). If
> the program aborts, you thus print the content of the stack in the
> singleton to std::cerr. However, some might find this to intrusive ?

See design goal #1 above. :-)

Usually there is a platform-specific way to do stack traces (I know there is
on Win32.) You can always supply your own BOOST_ASSERT or boost_error that
will do it.

Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at, gregod at, cpdaniel at, john at