Boost logo

Boost Users :

From: Mike\(dev\) (dev.wilson_at_[hidden])
Date: 2006-12-20 14:13:12


As does

assert( statement || !"Statement failed" )

which is 'faster' when statement == true

Mike

----- Original Message -----
From: "Andrew Holden" <aholden_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Monday, December 18, 2006 2:18 PM
Subject: Re: [Boost-users] BOOST_ASSERT and others

> Sebastian Redl wrote:
> > Maarten Nieber wrote:
> > > Sorry, I should have checked!
> > > It should be:
> > >
> > > assert( 2 + 2 == 4 && "Adding numbers failed!" )
> > >
> > That still won't fire. The concept is flawed. You cannot use assert()s
> > to print debug messages, because when an assert() prints a message, it
> > also stops the program.
>
> Actually, it will. The versions of assert that I have seen will print
> the complete expression that failed before they stop the program. This
> will include the string.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net