|
Boost : |
From: Hartmut Kaiser (hartmutkaiser_at_[hidden])
Date: 2004-01-05 05:31:29
Dan W. wrote:
> //file: verify.hpp
> #ifndef VERIFY_HPP
> #define VERIFY_HPP
>
> #ifdef _DEBUG
> # define verify(x) do{if(!((x)))asm int 3;}while(0)
> #else
> # define verify(x) (void)(0)
> #endif
>
> /*
>
> // Usage example:
> #include "verify.hpp"
> #include <stdio.h>
> char first_char( char const * s )
> {
> verify( s && ::strlen(s) ); //<-stops right on it ;-)
> return s[0];
> }
> // Cheers!
> // dan
>
> */
>
> #endif
That's more or less the same as contained in almost every <assert.h> header.
So what's new with your suggestion?
Regards Hartmut
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk