|
Boost : |
Subject: Re: [boost] [review][constrained_value] Review of Constrained Value Library begins today
From: Mika Heiskanen (mika.heiskanen_at_[hidden])
Date: 2008-12-21 07:49:49
Hello Peter,
Peter Simons wrote:
> Invariant failures, however, are unexpected conditions. Invariants are not
> supposed to fail. If they do, it's a sign of incorrect program logic or
> faulty assumptions. Your program will generally not be able to recover from
> such an error, hence invariant checking functions like assert() typically
> abort the process on failure (and generate debugging information, such as a
> core dump).
Thank you for your explanation Peter. However, I do not see why an assert
should be the first choice when a programming error can be detected by
the program itself. For example, I would prefer my word processor
to announce a programming error instead of producing a core dump.
Am I missing some finer point on the nature of invariants?
--> Mika Heiskanen
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk