From: David Abrahams (dave_at_[hidden])
Date: 2004-01-05 10:13:04
hartmutkaiser_at_[hidden] (Hartmut Kaiser) writes:
> Dan W. wrote:
>> > That's more or less the same as contained in almost every
>> <assert.h> header.
>> > So what's new with your suggestion?
>> asm int 3
>> assert() terminates the program and displays a stupid message.
>> verify() works like a Break-Point, it just stops on the line
>> that failed to verify, and you can look at the variables,
>> change them; you can choose to single-step from there. And
>> without the __FILE__ and __LINE__ macros, it's a lot more
>> ligthweight... *Use by the thousands!*
>> The only problem with it is that it breaks the C/C++
>> tradition of naming things something completely removed from
>> what they actually do... :)
> At least at Intel platforms assert() is nothing more, than a fancy wrapper
> for asm 3 (at least for VC7.1)!
And vc6, and vc7, and intel 5,6,7,8...
But not metrowerks, or cygwin gcc. I forget about MinGW. I don't
know about Borland either.
> And as for __LINE__ and __FILE__ - it's a matter of taste, if you
> want them to be included or not. I like to have this info.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk