Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost] [review][constrained_value] Review of Constrained Value Library begins today
From: Peter Simons (simons_at_[hidden])
Date: 2008-12-21 08:06:25


Hi Mika,

> 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?

apparently, you expect invariants to fail. They won't. Invariants never,
ever fail. They are invariant. These assumptions are the cornerstones on
which your algorithms are built. Adding code that throws an exception in
case of an invariant failure is wasted, because that exception will never
be thrown.

Invariants are checked only during development. Release binaries typically
don't contain those tests at all, i.e. assert() is disabled by compiling
with the preprocessor symbol NDEBUG defined.

Take care,
Peter


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net