Boost logo

Boost :

Subject: Re: [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,

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