Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-06-01 13:57:35

Rob Stewart <stewart_at_[hidden]> writes:

>> *explicitly. So before throwing them, you can make
>> sure that the broken invariant (if any) is restored .
>> If the invariant is restored, stack unwinding is safe.
> What about exceptions thrown to indicate a violated invariant?

Don't do that. Assert instead.

> That is, the basic guarrantee?

Huh? That has little or no relation to "exceptions thrown to indicate
a violated invariant".

> IOW, if an invariant is violated, the object can be left in a
> destructible state

Not in general. If an invariant is violated, you can't count on
anything, including destructibility.

Dave Abrahams
Boost Consulting

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