Boost logo

Boost :

From: Kevlin Henney (Kevlin.Henney_at_[hidden])
Date: 1999-09-01 06:32:30


Valentin Bonnard spotted:
> assertion(x ? t(3) : 3434==i+j, logic_error("must fobnicate before
we
> tweak"));

Objects of type string and logic_error will be created
for each assertion, even when ckecking is disabled.

[potentially expensive stuff deleted]

Where efficiency counts, in a loop, this is absolutely
unacceptable.

     True enough. If templated it differently, and placed a req on the
     parameter to be string constructible, then could rearrange it thus:

        assertion<logic_error>(x ? t(3) : 3434==i+j, "must frobnicate
        before we tweak");

     Kevlin


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