Boost logo

Boost :

From: Marc Jacobs (marcja_at_[hidden])
Date: 2002-10-30 18:01:59

"Martin" <m_at_[hidden]> wrote in message
> ~myContract()
> {
> // If this is a function in a class, we would imlement
> // testing of invariant conditions here. This would require
> // a reference to the object however.
> // Invariants are implemented here because this gets
> // executed even when exceptions are thrown
> }


> The biggest problem i see is the access to the input parameters from
> the class. This complicates the code and it means that with larger number
> parameters you have to write too much extra code.

The biggest problem I see is that you have no safe way to test invariants
from a destructor. There can be no return value from a destructor and
destructors should never throw if exception-safety is any kind of goal
(because if you arrived at that destructor because run() threw, for example,
and then the destructor threw, you'd end up with a terminated thread pretty

As for the rest, well, I'm having difficulty envisioning how you mean to
make this generic. Where will the author provide implementations for
preconditions, body, postconditions, etc. if not explicitly in the class
body as you have now?

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