Boost logo

Boost :

Subject: Re: [boost] [function] "paranoia" vs efficiency
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-10-02 10:26:59


Domagoj Saric wrote:
> As far as I can see boost::function<>::operator() performs:
> if (this->empty())
> boost::throw_exception(bad_function_call());
> before invoking the stored function (object)...
> My question is why or why only this "checked"/"safe" approach/method of
> invocation exists?

BOOST_ASSERT(!empty()) would be better in my opinion indeed, but it's
hard to make that change now for compatibility reasons.


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