Boost logo

Boost :

From: Jesse Jones (jesjones_at_[hidden])
Date: 2001-04-18 20:56:02

I've uploaded a new version of the DbC files. The implementation is
the same but the macros are closer to what Bill was proposing. There
are five macros:

REQUIRE (predicate)
This just does an ASSERT. It exists to make the code a bit more
intentional and to allow tools to extract preconditions from the

ENSURE (predicate)
This works exactly like REQUIRE.

Creates a stack based class to call the invariant. Clients have to
explicitly use this in order for their invariants to be called.

Makes a direct call to the invariant. This is useful in ctors and
dtors, eg if you use something like CHECK_INVARIANT in a dtor you
have to be careful to place the macro in its own scope so that the
invariant isn't called after the dtor runs.

OBSERVE (type, name, variable)
This now takes a name argument. This allows the OLD macro to be
tossed and allows variable to be an expression.

   -- Jesse

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