Boost logo

Boost :

From: Darren Cook (darren_at_[hidden])
Date: 2004-01-02 01:41:23

>> Has there been any discussion regarding an invariants library
>> (advanced assert), or is there one already implemented in boost?

There is smart-assert by John Torjo (
which might end up being submitted for Boost review. I've been using it on
some projects for a few months now and find it useful. If only there was a
way to generate a stack trace I might never need to use a debugger again :-).

> The compiler I'm using, Digital Mars version 8.38 already supports
> invariant, pre- and post-conditions. See...

Are there any other compilers planning to use these?

Is it working under the hood by generating assert commands, or doing
compile-time checking? E.g. would the square_root() example (included below)
create a compile-time error for this?

If so, what about this:
   void myfunc(long n){



        long square_root(long x)
                assert(x > 0);
            __out (result)
                assert((result * result) == x);
                return sqrt(x);

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