Boost logo

Boost :

From: Jesse Jones (jesjones_at_[hidden])
Date: 2001-04-09 17:35:14


At 12:02 AM +0300 4/10/01, Peter Dimov wrote:
>From: "Jesse Jones" <jesjones_at_[hidden]>
>
>> 6) Trying to invoke an empty function seems like a precondition
>> violation to me. Asserting instead of throwing seems preferable.
>
>I agree with most of your points, however invoking an empty function must
>throw for boost::function<T&> to be default constructable. (What would you
>return from op() if it didn't throw?)

There's no need to return anything. The client failed to meet his
obligations so the function can do anything it likes. In this case it
will crash on most OSs. But that's OK. :-)

   -- Jesse


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