Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-01-12 01:30:23


>
> ----------------------------------------------------
> #include <boost/smart_assert_ext.hpp>
>
> char first_char( char const * s ) {
> SMART_ASSERT( s && ::strlen(s) );
> return s[0];
> }
>
> int main(int,char**){
> using namespace boost::smart_assert;
> assert_settings().set_level_handler(lvl_debug, &debug_on_assert);
> char c=first_char("");
> }

Many thanks Darren ;)
The thing is that you don't even have to write:

assert_settings().set_level_handler(lvl_debug, &debug_on_assert);

It'll break on Debug by default, when on Debug mode, while
doing nothing on Release mode.

Best,
John


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