Tools.h++ Manual

104011 Tandem Computers Incorporated 18-3
18
An example is bounds checking: the cost of checking to make sure an index is
in range can well exceed the cost of the array access itself. If a program does a
lot of array accesses, checking every one may result in a slow program. To
avoid this, the library may require that the user always use a valid index.
Because a minimum level of correctness is being demanded, non-recoverable
errors must be relatively easy to avoid and simple in concept.
Non-recoverable errors are best discovered and eliminated by compiling and
linking your application with the debug version of the library. See
Section 18.4, “Debug version of the library” for details. The debug version
includes lots of extra checks designed to uncover coding errors. Some of these
checks may take extra time, or even cause debug messages to be printed out, so
you want to compile and link with the production version for an efficient final
product.
If the debug version of the library discovers an error it typically aborts the
program.