Boost logo

Boost :

Subject: Re: [boost] [function] function wrapping withnoexceptionsafetyguarantee
From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2010-10-24 00:00:37

On Sun, Oct 24, 2010 at 1:17 AM, Edward Diener <eldiener_at_[hidden]> wrote:
> On 10/23/2010 5:30 PM, Domagoj Saric wrote:


> I meant simply what I said. Please explain to me why boost::function
> throwing an exception when invoked on an empty target is objectionable to
> you. If I have misunderstand to what you are objecting I apologize, but it
> seems to me that you find this behavior incorrect somehow.

The question is not directed at me, but I feel compelled to answer it.
I do find it incorrect to throw when invoked on an empty target
because I feel that this should be a contract for operator() and
contracts should be checked with asserts, which make it easier for
debugging and have no overhead (RTTI or otherwise) when compiled with

> In reading the documentation it clearly states:
> "boost::bad_function_call — An exception type thrown when an instance of a
> function object is empty when invoked."

Unfortunately, breaking changes are very complicated to get in.


Felipe Magno de Almeida

Boost list run by bdawes at, gregod at, cpdaniel at, john at