Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-04-11 08:45:10


From: "Jesse Jones" <jesjones_at_[hidden]>

> >Yes, this makes sense. But introducing undefined behavior still feels
> >somewhat wrong to me. Undefined behavior is usually introduced when
validity
> >checks (a) will have severe performance impact, or (b) are impossible.
> >Neither of these applies.
>
> The problem is that as a library author you can't determine if
> checking preconditions in release is going to have a "severe
> performance impact". You have no idea how sensitive the app is to
> small performance hits and no idea how often clients are actually
> calling your function.

Not in general, but in this particular case I have a pretty good idea.
Calling a boost::function is a relatively costly operation; the check is
insignificant.

--
Peter Dimov
Multi Media Ltd.

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