Boost logo

Boost :

From: Ed Brey (edbrey_at_[hidden])
Date: 2001-08-29 16:00:15

From: "Fernando Cacciola" <fcacciola_at_[hidden]>

[No checking in release mode; throw exception in debug mode.]
> User should use some kind of is initialized. Exception handling is there in
> case the user forgets to do that.
> Anyway, with debug/release modes we are agreed on this.

Throwing an exception in debug mode only doesn't seem to provide much value. When debugging, you might as well just halt the program at the problem, which boils down to simply assert(precondition_is_true). This pinpoints the problem source and relieves the user of writing debug-only catches, as well as other exception-on-precondition-violation pitfalls.

The precondition violation topic has been thoroughly discussed. For a summary, see:

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