
1 Jun
2004
1 Jun
'04
6:57 p.m.
Rob Stewart <stewart@sig.com> 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 http://www.boost-consulting.com