Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2003-04-27 22:08:06


"Tanton Gibbs" <thgibbs_at_[hidden]> wrote in message
news:008301c30c42$13306760$7bdd550a_at_Corp.Acxiom.net...
>
> Enforce(cout) << Enforce(MakeWidget())->ToString();
>
> I would think that the compiler could optimize away the Enforce calls with
> NDEBUG defined, but when not defined it will catch NULL derefs as the
author
> intended.

Oops, it looks like a presentation mistake on my part; ENFORCE is intended
to be enabled at all times and not depend on NDEBUG. ENFORCE checks error
conditions that are intended to be shown to the user, not those that check
the application invariants.

Andrei


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk